Cs 101 Flashcards
How many steps does it take to delete an item from a binary search tree (BST)? When in (Words)?
O(n)
How many steps does it take to build a heap using the bottom up method?
O(n)
How many steps does it take to perform an extract min from a min ordered heap?
O(log n)
How many steps does it take to perform (-) operation on a que implemented as a linked list?
O(1)
The worst case to insert (-) Hash table takes how many steps?
O(n)
The goal of hashing is for (-) to take how many steps on average?
O(1)
Heap sort using a heap to sort n elements takes how many steps?
(n log n)
Which operation do hash tables NOT support:
Sorting
Which operation do heaps NOT support efficiently?
Search
After an exception is thrown and a catch block execute, execution resumes after the thrown statement.
False
For a function that may contain a throw, the function’s statements must be surrounded by a try block.
False
A key advantage of a class template is relieving the programmer from having to write redundant code that differs only by type.
True
A good hashing function should:
Spread the input values over the range of integer outputs.
Huffman Codes will provide the most benefit when:
There is a skewed distribution of the characters