Chapter 20-21 Quiz ?s Flashcards
Which statement is false?
A linked list is appropriate when the number of data elements to be shown is unpredictable
By convention, the link reference in the last node of a list is set to null to mark the end
A linked list is a linear collection of self-referential class objects called nodes connected by reference links
A linked list is a fixed-size data structure
A linked list is NOT a fixed size data structure
Java performs automatic ______ of objects that are no longer referenced in a program
Garbage collection
Which is false?
Because a wildcard is a type-parameter name, you can use it as a type name throughout a method’s body
If a wildcard is specified without an upper bound, than only the methods of type Object can be invoked on values of the wildcard type
A wildcard type argument is denoted by ? Which represents unknown type
Wildcard type arguments enable you to specify method parameters, return values, variables and so on, that act as super types of parameterized types
You cannot use a wildcard as a type name throughout a method’s body. It enables you to specify the method’s parameters, return values, variables or fields, etc. as supertypes or subtypes of parameterized types
What example is this:
List extends [class name]>
Wildcard type argument. It can receive any argument
All generic method declarations have a type parameter section delimited by _______
Angle brackets (< and >)
Generics provide _____ that allows programmers to catch invalid types at compile time
Compile-time type safety
False?
Insertions and deletions are made only at one end of a queue-tail
Binary trees facilitate high speed searching and sorting of data
Insertions and deletions are made only at one end of a stack it’s too
Linked lists are collections of data items “lined up in a row” insertions and deletions can be made anywhere in a linked list
Insertions are made at the back (tail)
Deletions are made at the front (head)
A queue is a _____ data structure
FIFO
Queue nodes are removed only from the ___ of the queue, and are inserted only at the _____ of the queue
Head
Tail
Usually a ____ _______ in Java code indicates the end of a data structure
Null reference
Suppose Stack is a generic class that has one type parameter
The assignment is
Permitted but unsafe, the compiler issues a warning message
Which statement is false?
A nose can be inserted at any point in a binary search tree
The binary search tree facilitates duplicate elimination
The shape of a binary search tree that corresponds to a set of data can vary depending on the order in which the values are inserted into the tree
The process of creating a binary search tree actually sorts the data, and thus this process is called the binary tree sort
A node cannot be inserted at any point in a binary tree because it will through off the sorting
______ is the default upper bound of a type parameter
Object
A stack is a ______ data structure
LIFO
Which is not a typical application of queues?
High speed sorting
Routing packets in a computer network
File server handling file access requests from many clients
Print spooling
High speed sorting