CS 124 Study

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

Big-Oh Efficiency Add an element to a queue implemented as a linked list.

O(1)

Big-Oh Efficiency Add an element to the head of the singly-linked list.

O(1)

Big-Oh Efficiency Add an element to the tail of the doubly-linked list.

O(1)

Big-Oh Efficiency Pop an element off a stack implemented as a linked list.

O(1)

Big-Oh Efficiency Push an element onto a stack implemented as a linked list.

O(1)

Big-Oh Efficiency Remove an element from a queue implemented as a linked list.

O(1)

Big-Oh Efficiency Hash Table Finding an element

O(1)

Suppose you want to find both the smallest and the largest value in a sorted array. What is the big-Oh efficiency of the best algorithm for the task?

O(1)

Big-Oh Efficiency Add an element to the tail of the vector.

O(1)+

Big-Oh Efficiency Hash Table Adding an element

O(1)+

Big-Oh Efficiency Hash Table Removing an element

O(1)+

Big-Oh Efficiency Hash Table Iterating over all elements (in terms of b)

O(b)

Big-Oh Efficiency Inserting or removing a heap element

O(log(n))

Big-Oh Efficiency Balanced Binary Search Tree Find/Add/Remove and element

O(log(n))

Big-Oh Efficiency Red-Black Tree Add/Remove and element

O(log(n))

Big-Oh Efficiency Quicksort

O(n log(n))

Big-Oh Efficiency Heapsort

O(n log(n))

Big-Oh Efficiency Mergesort

O(n log(n))

Big-Oh Efficiency Add an element to the head (position 0) of the vector.

O(n)

Big-Oh Efficiency Add an element to the tail of the singly-linked list.

O(n)

Big-Oh Efficiency Remove an element at position n / 2 in the doubly-linked list.

O(n)

Big-Oh Efficiency Remove an element at position n / 2 in the vector.

O(n)

Big-Oh Efficiency (Best) Bubble sort

O(n)

Big-Oh Efficiency Unbalanced Binary Search Tree Find/Add/Remove and element

O(n)

Suppose you want to find both the smallest and the largest value in an unsorted array. What is the big-Oh efficiency of the best algorithm for the task?

O(n)

Big-Oh Efficiency Bubble sort

O(n^2)

Big-Oh Efficiency Selection sort

O(n^2)

Big-Oh Efficiency (Worst) Quicksort

O(n^2)

Suppose you search for a value in an unsorted array of 100 elements, but the element turns out not to be present, how many values would you need to visit? a) 100 b) 50 c) At most 7 d) None of the above

a) 100

Which of these functions has the largest Big Oh growth rate? a) 3n^2 - 50 b) 50n + 100n c) 2500n - 50 d) They are all the same

a) 3n^2 - 50

The header file needed for reading and writing files is a) <fstream> b) <filestream> c) Both a and b d) None of the above

a) <fstream>

Which of the following statements is true? a) A class by default hides the implementation details of data members and member functions. b) Class data members are set in the constructor and cannot be changed later by class member functions c) Both a and b d) None of the above

a) A class by default hides the implementation details of data members and member functions.

Which of the following statements is true? a) A linked list is made up of nodes, each of which has at least one pointer a neighboring node. b) Accessing any data stored in a linked list is through random access, with efficiency of O(1) c) Both a and b d) None of the above

a) A linked list is made up of nodes, each of which has at least one pointer a neighboring node.

Which of the following statements is true? a) A queue follows first-in first-out retrieval b) A stack follows first-in first-out retrieval c) Both a and b d) None of the above

a) A queue follows first-in first-out retrieval

Which of the following statements is true? a) A root of a tree is a node with no parent b) Except for the root, all other nodes have exactly two parents. c) Both a and b d) None of the above

a) A root of a tree is a node with no parent

An Abstract Data Type (ADT) a) Describes the expected data and the needed operations on the data. b) Defines the programming language, function names, and variable types to use for the data structure. c) Both a and b d) None of the above

a) Describes the expected data and the needed operations on the data.

An Abstract Data Type (ADT) a) Describes the expected data and the needed operations on the data. b) Specifies implementation details such as programming language, function names, and variable types. c) Both a and b d) None of the above

a) Describes the expected data and the needed operations on the data.

Which of the following statements is true? a) For bubble sort, the best time complexity is when the dataset is sorted. b) For quick sort, the best time complexity is when the dataset is sorted. c) Both a and b d) None of the above

a) For bubble sort, the best time complexity is when the dataset is sorted.

Which of the following statements is true? a) For quick sort, the worst time complexity is when the pivot is the largest value of the dataset. b) For quick sort, the best time complexity is when the pivot is the smallest value of the dataset. c) Both a and b d) None of the above

a) For quick sort, the worst time complexity is when the pivot is the largest value of the dataset.

Which of the following statements is true? a) For quick sort, the worst time complexity is when the pivot is the smallest value of the dataset. b) For quick sort, the best time complexity is when the pivot is the largest value of the dataset. c) Both a and b d) None of the above

a) For quick sort, the worst time complexity is when the pivot is the smallest value of the dataset.

Which of the following statements is true? a) For selection sort, if the time to sort 5 items is 2 seconds, the time for 50 items would be 200 seconds. b) For insertion sort for sorted lists, if the time to sort 5 items is 2 seconds, the time for 50 items is 200 seconds. c) Both a and b d) None of the above

a) For selection sort, if the time to sort 5 items is 2 seconds, the time for 50 items would be 200 seconds.

Which of the following statements is true? a) Insertion sort has an expected time complexity of n^2 for random lists b) For selection sort, if the time to sort 50 items is 5 seconds, the time for 150 items would be 15 seconds c) Both a and b d) None of the above

a) Insertion sort has an expected time complexity of n^2 for random lists

Which of these sorting algorithms has the most efficient time complexity for random lists? a) Merge sort b) Insertion sort c) Selection sort d) None of the above

a) Merge sort

Consider a stack implemented as singly-linked list with head and tail pointer. It is more efficient to a) Push elements at the beginning of the list. b) Pop elements at the end of the list. c) Both a and b d) None of the above

a) Push elements at the beginning of the list.

Which of the following statements is true? a) Selection sort has an expected time complexity of n^2 for random lists. b) Selection sort has an expected time complexity of n for sorted lists. c) Both a and b d) None of the above

a) Selection sort has an expected time complexity of n^2 for random lists.

Which of the following statements is true? a) Separate chaining requires linked lists. b) Open addressing requires linked lists. c) Both a and b d) None of the above

a) Separate chaining requires linked lists.

The public interface of the class a) Tells what can be done with the class objects. b) Is a set of objects with the same behavior. c) Both a and b d) None of the above

a) Tells what can be done with the class objects.

Which of the following statements is true? a) The expected time complexity of quick sort is O(n log(n)) b) The worst time complexity of quick sort is O(n log(n)) c) Both a and b d) None of the above

a) The expected time complexity of quick sort is O(n log(n))

Consider a queue implemented as a singly-linked list with head and tail pointer. It is more efficient to locate a) The front of the queue at the start of the list. b) The front of the queue at the end of the list. c) Both a and b d) None of the above

a) The front of the queue at the start of the list.

Which of the following statements is true? a) The merge sort algorithm includes dividing the array in half and recursively sorting each half. b) The bubble sort algorithm includes finding the position of the smallest value in the dataset. c) Both a and b d) None of the above

a) The merge sort algorithm includes dividing the array in half and recursively sorting each half.

Consider a stack implements as a singly-linked list with head and tail pointer. It is more efficient to locate a) The top of the stack at the start of the list. b) The top of the stack at the end of the list. c) Both a and b d) None of the above

a) The top of the stack at the start of the list.

In a binary search tree a) all left descendants are smaller than the node b) all right descendants are smaller than the node c) Both a and b d) None of the above

a) all left descendants are smaller than the node

To write text files, use variables of type a) fstream b) ifstream c) Both a and b d) None of the above

a) fstream

Which of these Big Oh expressions has the smallest growth rate? a) log(n) b) n log(n) c) n d) They are all the same

a) log(n)

Which of these Big Oh expressions has the smallest growth rate? a) n b) n log(n) c) n! d) They are all the same

a) n

A node in a binary tree may have how many child nodes? a) exactly 2 b) 0, 1, or 2 c) Both a and b d) None of the above

b) 0, 1, or 2

A node in binary search tree may have how many child nodes? a) exactly 2 b) 0, 1, or 2 c) Both a and b d) None of the above

b) 0, 1, or 2

Which of these functions has the smallest Big Oh growth rate a) n^2 + 10n -3000 b) 100n + 50000 c) 100n^3 - 5000 d) They are all the same

b) 100n + 50000

Which of the following values are valid elements in a set a) 4, 7, 9, 1, 4 b) 5, 6, 2, 1, 3 c) Both a and b d) None of the above

b) 5, 6, 2, 1, 3

Which of the following values are valid elements in a set? a) 4, 7, 9, 1, 4 b) 5, 6, 2, 1, 3 c) Both a and b d) None of the above

b) 5, 6, 2, 1, 3

Which of these functions has the largest Big Oh growth rate a) 100n - 50 b) 50n^2 + 100n c) 2500n + 50 d) They are all the same

b) 50n^2 + 100n

Which of the following statements is true? a) A hash function typically takes the data (such as a string) as a parameter and returns that same type. b) A good hash function minimizes collisions. c) Both a and b d) None of the above

b) A good hash function minimizes collisions.

Which of the following statements is true? a) An interior node is a node with no children b) A leaf is a node with no children c) Both a and b d) None of the above

b) A leaf is a node with no children

Which of the following statements is true? a) A stack follows first-in first-out retrieval. b) A queue follows first-in first-out retrieval. c) Both a and b d) None of the above

b) A queue follows first-in first-out retrieval.

Which of the following statements is true? a) Adding an element at the end of an array of size n, is an O(n) operation b) Adding an element at the end of a vector of size n, is an O(1)+ operation c) Both a and b d) None of the above

b) Adding an element at the end of a vector of size n, is an O(1)+ operation

A binary search for a value in a sorted array of 1 million elements would require a visit to at most 20 values. How many values would we need to visit if searching in a sorted array of 2 million elements? a) At most 20 b) At most 21 c) At most 40 d) None of the above

b) At most 21

A binary search for a value in a sorted array of 100 elements would require a visit to at most 7 values. How many values would we need to visit if searching in a sorted array of 200 elements. a) At most 7 b) At most 8 c) At most 14 d) None of the above

b) At most 8

A binary search for a value in a sorted array of 100 elements would require a visit to at most 7 values. a) At most 8 b) At most 9 c) At most 14 d) None of the above

b) At most 9

Which of the following statements is true? a) For a mostly-sorted list, quick sort provides a better expected time than bubble sort. b) For a mostly-sorted list, insertion sorted provides a better expected time than selection sort. c) Both a and b d) None of the above

b) For a mostly-sorted list, insertion sorted provides a better expected time than selection sort.

Which of the following statements is true? a) For a partially-sorted list, selection sort provides a better expected time than bubble sort. b) For a partially-sorted list, insertion sort provides a better expected time than selection sort. c) Both a and b d) None of the above

b) For a partially-sorted list, insertion sort provides a better expected time than selection sort.

Which of the following statements is true? a) For quick sort, the best time complexity is when the pivot is the largest value of the dataset. b) For quick sort, the best time complexity is when the pivot is the median value of the dataset. c) Both a and b d) None of the above

b) For quick sort, the best time complexity is when the pivot is the median value of the dataset.

Which of the following statements is true? a) For quick sort, the worst time complexity is when the pivot is the median value of the dataset. b) For quick sort, the best time complexity is when the pivot is the median value of the dataset. c) Both a and b d) None of the above

b) For quick sort, the best time complexity is when the pivot is the median value of the dataset.

For best efficiency, the priority queue is usually implemented as a a) Set b) Heap c) Map d) None of the above

b) Heap

Which of the following statements is true about Heapsort? a) Like Mergesort, Heapsort uses an additional array during the sorting process. b) Heapsort works by inserting elements into a heap and removing them in priority order c) Both a and b d) None of the above

b) Heapsort works by inserting elements into a heap and removing them in priority order

Which of theses sorting algorithms has the most efficient time complexity for sorted lists? a) Quick sort b) Insertion sort c) Merge sort d) They are all the same

b) Insertion sort

Which of the following statements is true? a) Merge sort best time complexity is O(n) b) Merge sort expected time complexity is O(n log(n)) c) Both a and b d) None of the above

b) Merge sort expected time complexity is O(n log(n))

If the hash function is effective, the lookup efficiency of the hash table is a) O(n) b) O(1) c) O(log n) d) None of the above

b) O(1)

If the hash functions is effective, the lookup efficiency of the hash table is a) O(n) b) O(1) c) O(log n) d) None of the above

b) O(1)

If a binary tree is balanced, insertion or removal in binary tree has expected efficiency of a) O(n log(n)) b) O(log (n)) c) O(1) d) None of the above

b) O(log (n))

Insertion or removal of an element from a heap has expected efficiency of a) O(n log(n)) b) O(log (n)) c) O(1) d) None of the above

b) O(log (n))

If a binary tree is balanced, insertion and removal in binary tree have expected efficiency of a) O(n) b) O(log n) c) O(1) d) None of the above

b) O(log n)

Binary search, assuming data is already sorted, has time complexity of a) O(n^2) b) O(log(n)) c) O(n) d) None of the above

b) O(log(n))

The benefits of encapsulation include a) Allowing a function defined in one class to be reused in another class. b) Protecting data of objects from being changed in an inconsistent manner. c) Both a and b d) None of the above

b) Protecting data of objects from being changed in an inconsistent manner.

Consider a queue implemented as a singly-linked list with head and tail pointer. It is more efficient to located a) Push elements at the beginning of the list. b) Push elements at the end of the list. c) Both a and b d) None of the above

b) Push elements at the end of the list.

Which of the following statments is ture? a) Quick sort expected time complexity is O(n^2) b) Quick sort worst time complexity is O(n^2) c) Both a and b d) None of the above

b) Quick sort worst time complexity is O(n^2)

Which of the following statements is true? a) The insertion sort algorithm includes swapping array values into the correct location. b) The merge sort algorithm is more efficient than selection sort. c) Both a and b d) None of the above

b) The merge sort algorithm is more efficient than selection sort.

If a programmer wants to use the string class in C++ a) They must know the private implementation of the string class b) They must know the public interface of the string class c) Both a and b d) None of the above

b) They must know the public interface of the string class

Consider an unsorted data set which will be searched once every hours for 5 days per week throughout a semester. Which search process would you choose? a) Use selection sort once and then binary search. b) Use quick sort once and then binary search. c) Linear search. d) None of the above

b) Use quick sort once and then binary search.

Which of the following statements is true? a) Abstraction allows a function defined in one class to be reused in another class. b) With private data members, only the member functions of the class can access the data members c) Both a and b d) None of the above

b) With private data members, only the member functions of the class can access the data members

To read text files use variables of type a) fstream b) ifstream c) Both a and b d) None of the above

b) ifstream

Which of these functions has the smallest Big Oh growth rate? a) n^2 + 5n -3 b) n + 10000n + 100 c) n^3 - 500n - 5000 d) They are all the same

b) n + 10000n + 100

Which of these Big Oh expressions has the largest growth rate? a) n^2 b) n! c) n^20 d) None of the above

b) n!

Which of these Big Oh expressions has the largest growth rate? a) n^2 b) n! c) n^3 d) They all are the same

b) n!

Which of these Big Oh expressions has the largest growth rate? a) n^2 b) n log(n) c) 2^n d) They are all the same

c) 2^n

A map can be used to a) Associate keys with values b) Implement a telephone number database c) Both a and b d) None of the above

c) Both a and b

The public interface of the class a) Is a collection of member functions b) Allows objects of the class to be accessed. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is the true about the "perfect" hash table? a) The table is a perfect size to hold all relevant data with no wasted memory b) There are no collisions. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true about Heapsort? a) The best case efficiency for Heapsort is O(n log(n)) b) The worst case efficiency for Heapsort is O(n log(n)) c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true about selection sort? a) The algorithm includes finding the position of the smallest value in the dataset. b) The algorithm includes values swapping positions with each other. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true of the algorithm for finding an item in a hash table? a) It includes computing the hash code and compressing the hash code (if applicable) b) It is dependent on the method of collisions management. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) A hash code is an integer value calculated from data. b) A hash code helps determine the location of the data in the hash table. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) A hash table can be an array that stores data elements b) A hash table can be an array that stores pointers to linked lists. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) A map is implemented as a set of key/value pairs. b) Unordered sets are usually more efficient than ordered sets. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) Adding an element in the middle or beginning of an array of size n, is an O(n) operation. b) Accessing any data stored in an array is through random access, with efficiency of O(1). c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) An input stream is a source of data. b) An output stream is a destination for data. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) Bubble sort has an expected time complexity of n^2 for random lists b) Selection sort has an expected time complexity of n^2 for random lists c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) Encapsulation is when implementation details of a class is hidden. b) Every object of a defined class has its own set of data members, with possible different values. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) Every object of a defined class has its own set of data members, with possibly different values. b) With private data members, only the member functions of the class can access the data members. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) For a partially-sorted list, bubble sort provides a better expected time than selection sort. b) For a partially-sorted list, insertion sort provides a better expected time than selection sort. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) For bubble sort for sorted lists, if the time to sort 5 items is 3 seconds, the time for 10 items is 6 seconds. b) For selection sort, if the time to sort 5 items is 10 seconds, the time for 15 items would be 90 seconds. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) For selection sort, if the time to sort 50 items is 5 seconds, the time for 150 items would be 45 seconds. b) For bubble sort for sorted lists, if the time to sort 20 items is 2 seconds, the time for 60 items is 6 seconds. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) In C++ there are 3 types of file streams: fstream, ofstream, ifstream. b) To open a file, use the class member function open and the file name. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) In a linked list with head and tail pointers, adding an element at the beginning is an O(1) operation. b) In a linked list with head and tail pointers, adding an element at the end is an O(1) operation. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) In a linked list, location the kth element is an O(k) operation. b) In a linked list, adding an element at the beginning is an O(1) operation. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) In a priority queue, all elements are ordered according to each of its priority. b) Three basic operations of a priority queue are push, pop, top c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) In a set, there are no duplicate elements. b) Unordered sets are usually more efficient than ordered sets. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) In linear search, of the expected time to search 15 items is 3 seconds, the time for 30 items is 6 seconds. b) For bubble sort for sorted lists, if the time to sort 5 items is 3 seconds, the time for 10 items is 6 seconds. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) In the map (ADT), the key values are unique. b) In C++ STL implementation of the map, there is map and unordered_map c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) In the set (ADT), the elements are unordered. b) Un C++ STL implementation of the set, there is set and unordered_set c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) Insertion sort has an expected time complexity of n for sorted lists. b) Bubble sort has an expected time complexity of n for sorted lists c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) Insertion sort has an expected time complexity of n^2 for random lists. b) Insertion sort has an expected time complexity of n for sorted lists. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) Quick sort best time complexity is O(n log(n)) b) Quick sort worst time complexity is O(n^2) c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) The insertion sort algorithm includes shifting array values to locate the correct location for insertion. b) The bubble sort algorithm includes swapping adjacent values. c) Both a and b d) None of the above

c) Both a and b

Which of the following statements is true? a) The quick sort algorithm is more efficient than selection sort. b) The merge sort algorithm includes dividing the array in half and recursively sorting each half. c) Both a and b d) None of the above

c) Both a and b

Which of the following values are valid elements in a set? a) cherry, apple, orange, peach b) jujubi, dragonfruit, jackfruit, coconut c) Both a and b d) None of the above

c) Both a and b

Which of these sorting algorithm has the most efficient time complexity for sorted lists? a) Selection sort b) Merge sort c) Bubble sort d) None of the above

c) Bubble sort

Which of these sorting algorithms has the most efficient time complexity for sorted lists? a) Selection sort b) Merge sort c) Bubble sort d) None of the above

c) Bubble sort

Consider an unsorted dataset which will be searched only once for a specific value. Which search process would you choose. a) Use merge sort and then binary search. b) Use quick sort and then binary search. c) Linear search d) None of the above

c) Linear search

A library wants to track the current patron for each book that is currently checked out. Which data structure would be best for this purpose? a) Array b) Set c) Map d) None of the above

c) Map

Linear search has time complexity of a) O(n^2) b) O(log (n)) c) O(n) d) None of the above

c) O(n)

Linear search has time complexity of a) O(n^2) b) O(log(n)) c) O(n) d) None of the above

c) O(n)

Which of these sorting algorithms has the most efficient time complexity for random lists a) Selection sort b) Insertion sort c) Quick sort d) None of the above

c) Quick sort

Which of these sorting algorithms has the most efficient time complexity for random lists? a) Selection sort b) Insertion sort c) Quick sort d) None of the above

c) Quick sort

A specific type of binary tree that rebalances after each insertion and removal is called a) Huffman Tree b) Binary Search Tree c) Red-Black trees d) None of the above

c) Red-Black trees

A school library keeps a collection of web sites that are blocked at student computers. In a program to check for blocked sites, which would be the most efficient data structure to used to store the site? a) Vector b) Array c) Set d) None of the above

c) Set

Which of these functions has the smallest Big Oh growth rate? a) n^2 + 5n - 3 b) n^3 + 100n +5000 c) n - 5000n - 50 d) None of the above

c) n - 5000n - 50

C++ constructors a) Are declared with keyword 'constructor' b) Do not have any parameters c) Both a and b d) None of the above

d) None of the above

The benefits of encapsulation include a) Preventing functions internal to the class to change private data members. b) Allowing a function defined in one class to be reused in another class. c) Both a and b d) None of the above

d) None of the above

Which of the following statements is true about selection sort? a) Selection sort is known for being a fast sorting algorithm on large datasets. b) If the time to sort 100 items is 10 seconds, the time to sort 200 items would be 20 seconds. c) Both a and b d) None of the above

d) None of the above

Which of the following statements is true? a) Adding an element in the beginning of a linked list of size n, is an O(n) operation. b) Adding an element at the end of an array of size n, is an O(n) operation. c) Both a and b d) None of the above

d) None of the above

Which of the following statements is true? a) Encapsulation prevents functions internal to the class to change private data members. b) Class members are by default public and struct members are by default private. c) Both a and b d) None of the above

d) None of the above

Which of the following statements is true? a) For a singly-linked list of 3 nodes to hold 3 pieces of data, only 3 pointers are needed. b) For a doubly-linked list of 3 nodes to hold 3 pieces of data, only 3 pointers are needed. c) Both a and b d) None of the above

d) None of the above

Which of the following statements is true? a) For merge sort, the best time complexity is O(n) when the dataset is sorted. b) For quick sort, the best time complexity is O(n) when the dataset is sorted. c) Both a and b d) None of the above

d) None of the above

Which of the following statements is true? a) In a singly-linked list with head and tail pointers, adding an element at the beginning is an O(n) operation. b) In a singly-linked list with head and tail pointers, adding an element at the end is an O(n) operation. c) Both a and b d) None of the above

d) None of the above

Which of the following statements is true? a) The insertion sort algorithm includes finding the position of the smallest value in the dataset. b) The bubble sort algorithm includes finding the position of the smallest value in the dataset. c) Both a and b d) None of the above

d) None of the above

Which of these functions has the smallest Big Oh growth rate? a) 100n^2 + 10n - 3000 b) 10000n^2 + 50n + 10 c) 50n^2 - 500n - 5000 d) They are all the same

d) They are all the same

Which of these functions has the smallest Big Oh growth rate? a) n^2 - 50 b) n^2 + 10n c) n^2 - 500n - 5000 d) They are all the same

d) They are all the same


Set pelajaran terkait

Chp 19 the Urinary System and Body Fluids

View Set

Fundamentals of success in Business questions

View Set

Stroke, Stroke NCLEX, HESI- Brain Attack (Stroke), Brain Attack / Stroke, Chapter 45 Care of Critically ILL Patients with Neurologic Problems, Stroke nclex problems, HEC IGGY 45/TBI, stroke, brain attack

View Set

Chapter 53: Drug Therapy for Seizure Disorders and Spasticity

View Set

EAQ Maternity, Women's Health Disorders Childerbearing Health Promotion

View Set

ACSM's Guidelines for Exercise Testing and Prescription Chapters 1-12

View Set