Question # 1 of 10 ( Start time: 11:18:18 AM ) Total Marks: 1

The main reason of using heap in priority queue is

code is readable

less code

heap can't be used in priority queues

**improve performance**code is readable

less code

heap can't be used in priority queues

**Question # 2 of 10 ( Start time: 11:18:18 AM ) Total Marks: 1**

**We implement the heap by**

**____________**

Threaded Tree

AVL tree

**Complete binary tree**

Expression

Question # 3 of 10 ( Start time: 11:18:18 AM ) Total Marks: 1

A simple sorting algorithm like selection sort or bubble sort has a worst-case of

O(1) time because all lists take the same amount of time to sort

O(n) time because it has to perform n swaps to order the list.

**O(n**

^{2}) time because sorting 1 element takes O(n) time - After 1 pass through the list,**either of these algorithms can guarantee that 1 element is sorted.**

O(n

^{3}) time, because the worst case has really random input which takes longer to.Question # 4 of 10 ( Start time: 11:18:18 AM ) Total Marks: 1

If we want to find median of 50 elements, then after applying buildHeap method, how many times deleteMin method will be called ?

Select correct option:

5

Select correct option:

5

**25**

35

50

50

Question # 5 of 10 ( Start time: 11:18:18 AM ) Total Marks: 1

Which one of the following is NOT true regarding the skip list?

**Each list S**

_{i}contains the special keys + infinity and - infinity.

List S

_{0 }contains the keys of S in non-decreasing order.Each list is a subsequence of the previous one.

**List S**

_{h}contains only the n special keys.

Question # 6 of 10 ( Start time: 11:18:18 AM ) Total Marks: 1

Which of the following is not true regarding the maze generation?

**Randomly remove walls until the entrance and exit cells are in the same set.**

Removing a wall is the same as doing a union operation.

**Remove a randomly chosen wall if the cells it separates are already in the same set.**

Do not remove a randomly chosen wall if the cells it separates are already in the same set.

Question # 7 of 10 ( Start time: 11:18:18 AM ) Total Marks: 1

Question # 7 of 10 ( Start time: 11:18:18 AM ) Total Marks: 1

Which property of equivalence relation is satisfied if we say: Ahmad R(is related to) Ahmad

Reflexivity

**Symmetry****Transitivity**

Question # 8 of 10 ( Start time: 11:18:18 AM ) Total Marks: 1

Heap is empty

**Heap is full**

Heap is not empty

Not a valid expression

Question # 9 of 10 ( Start time: 11:18:18 AM ) Total Marks: 1

We implement the heap by

Threaded Tree

AVL tree

**Complete binary tree**

Expression

Question # 10 of 10 ( Start time: 11:18:18 AM ) Total Marks: 1

**Which of the following statement concerning heaps is NOT true?**

**Traversing a heap in order provides access to the data in numeric or alphabetical order**

__.__**Removing the item at the top provides immediate access to the key value with highest (or lowest) priority.**

Inserting an item is always done at the end of the array, but requires maintaining the heap property.

A heap may be stored in an array.