Big O Notation

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

O(logn)

Remove (dequeue and restore heap) the maximum key from a Maximum Binary Heap

O(logn)

Remove (dequeue) the maximum key from a Maximum Binary Heap

O(1)

Assuming a NodeList implementation of a Queue (as in Lab #3), the enqueue operation time complexity is:

O(1)

Assuming a NodeList implementation of a Stack (as in Lab #2), the push operation time complexity is:

O(1)

Assuming a circular array implementation for a Queue as in Lab 3, the enqueue() operation is:

O(nlogn)

Best general case achievable time complexity for a comparison based sorting algorithm, starting with a random and unordered set of "n" integers

O(nlogn)

Build a Binary Heap by repeated insertion (enqueue) of keys

O(n)

Build a Binary Heap using the Bottom Up method

O(1)

Choose the Big O time complexity description for appending an element at the end of a Python List (array) as presented or implemented in this class.

O(n)

Choose the Big O time complexity description for removing an element at the beginning (index 0) of a Python List (array) as presented or implemented in this class.

O(nlogn)

Choose the big O description that provides the tightest accurate running time bound for dequeueing n items from a binary heap (average case) as presented or implemented in this class.

O(1)

Find (but do not remove/dequeue) the minimum key in a Min Binary Heap

O(logn)

Find a key in a well-balanced Binary Search Tree

O(n)

Find the minimum key in a Max Binary Heap

O(n^2)

For a particular algorithm, if the number of operations as a function of n is determined be 7n2 + 3n + 27, the Big O time complexity for that algorithm is said to be:

O(1)

Given a key, remove the key/value pair from a hash table (typical case, efficient hash table, low load factor)

O(1)

Given a key, retrieve the key/value pair in a hash table (typical case, efficient hash function, low load factor)

O(n^2)

Insertion sort on an unsorted random set of "n" integers

O(n^2)

Perform Bubble sort on random set of data

O(nlogn)

Perform Heap Sort on random set of data

O(n)

Pop all "n" items from a stack and enqueue them to a Queue - overall time complexity is:

O(n^2)

Run Quick Sort on an unsorted array of random integers, using the first index as the pivot.Run Quick Sort again on the result from above, again using the first index as the pivot.

O(n)

Search for a specific data item in a well-balanced Binary Search Tree without knowing the associated key.

O(n^2)

Selection sort on an unsorted random set of "n" integers

Not enough information

To dequeue an item from a queue (do not assume an implementation), the Big O time complexity is:

O(n^2)

Which of the following best describes the time complexity of the following function? def sum_list(py_list): x = 0 for i in range(len(py_list)): x += py_list.pop(0) return x

O(n)

adding n elements to a hash table as presented or implemented in this class, assuming a low load factor and efficient hash function.


Set pelajaran terkait

Business Communications Ch 1, Business communications ch 2, Business Communications ch 3, Business Communications ch 4, Business Communications ch 5, Business Communication ch 6, Business Communications ch 7, Business Communications ch 12

View Set

basic floating and basic skills in swimming

View Set

Foundations of Economics Vocabulary

View Set

在邮局寄信(in the post office)

View Set

Mastery Assignment 1: Mastering Introduction to Biology Quiz

View Set

Nouns, verbs, adjectives, adverbs, etc..

View Set

last chance to get it right before the big day

View Set

Module 17: Ionic and Covalent Bonds and Compounds

View Set