DAT 305 Week 2 Apply – Wk 2 Quiz

0 items
DAT 305 Week 2 Apply - Wk 2 Quiz
DAT 305 Week 2 Apply – Wk 2 Quiz
$8.00
  • Description

DAT 305 Week 2 Apply – Wk 2 Quiz

Which of the following describes the worst performance of merge sort?

a. O(n log n)

b. O(log n)

c. O(n)

d. O(n2)

If after partitioning the pivot always ends up in the middle, which of the following will be the performance of quicksort?

a. O(n2)

b. O(log n)

c. O(n)

d. O(n log n)

Which of the following describes the ordering of a stack?

a. First in first out

b. Last in last out

c. Last in first out

d. First in second out

Which of the following statements is true for a doubly linked list?

a. It has at least two pointers in each node

b. It has a backup of the data

c. It has twice the number of nodes as a normal linked listed

d. It stores the elements in a sorted manner

Which of the following is a formula to search for an item in a linked list?

a. O(n)

b. O(2n)

c. O(log n)

d. O(1)

Which of the following is an advantage of implementing a queue using an array?

a. It prioritizes the elements in the queue

b. It does not have to keep a head and a tail pointer

c. It is more efficient if the exact size of the input is known upfront

d. It is not restricted by a static size