Final Flashcards
O(1)
Called bounded time
Amount of work is not dependent on the size of the problem
Adding an item to an array has an order of O(1)
O(log2n)
Called logarithmic time
Used with algorithms that can cut the amount of data to be processed in half
Binary Search would be O(log2N)
O(N)
Called linear time
Adding together the elements of an array is O(N)
O(N log2N)
Called N log N time
Quick sort, Heapsort, merge sort have N log N complexity
O(N2)
Called quadratic time
Some simple sorting algorithms are O(N2)
O(2N)
Called exponential time
Are extremely costly
T or F
LLObjectNode class is a self referential class
True
When comparing two objects using the equals method inherited from the Object class, the contents of the objects are being compared
T or F
False
JDK has always contained the Java Collections Framework
T/F
False
Stack is FIFO
T/F
False
We allow duplicate elements in our lists
True
Final variable
Holds a value that cannot be changed
Which sequence of operations leaves a stack unchanged?
Push and then pop
The stackunderflowexception could be thrown by which stack methods?
Pop and top
The stackoverflowexception can be thrown by
The push method
One method calls another method which calls another method, the activation records are stored in
A stack