Question # 1 of 10
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

  • 25

35
50
Question # 2 of 10
If Ahmed is cousin of Ali and Ali is cousin of Asad then Ahmed is also cousin of Asad. This statement has the following property
Select correct option:
Reflexivity
Symmetry

  • Transitivity

All of the above
Question # 3 of 10
If we want to find 3rd minimum element from an array of elements, then after applying buildHeap method, how many times deleteMin method will be called ?
Select correct option:
1
2

  • 3

4
Question # 4 of 10
The preculateDown procedure will move the smaller value__ and bigger value____.
Select correct option:
left,right
right,left
up,down

  • down,up

Question # 5 of 10
If the height of a perfect binary tree is 4. What will be the total number of nodes in it?
Select correct option:

  • 15

16
31
32
Question # 6 of 10
The worst case of building a heap of N keys is _____ .
Select correct option:
N
N^2

  • NlogN

2^N
Question # 7 of 10
Which of the following method is helpful in creating the heap at once?
Select correct option:

  • insert

add
update
preculateDown
Question # 8 of 10
Consider a min heap, represented by the following array: 11,22,33,44,55 After inserting a node with value 66.Which of the following is the updated min heap?
Select correct option:

  • 11,22,33,44,55,66

11,22,33,44,66,55
11,22,33,66,44,55
11,22,66,33,44,55
Question # 9 of 10
Which of the following heap method lowers the value of key at position ‘p’ by the amount ‘delta’?
Select correct option:
increaseKey(p,delta)

  • decreaseKey(p,delta)

preculateDown(p,delta)
remove(p,delta)
Question # 10 of 10
Consider a min heap, represented by the following array: 3,4,6,7,5 After calling the function deleteMin().Which of the following is the updated min heap?
Select correct option:
4,6,7,5

  • 6,7,5,4

4,5,6,7
4,6,5,7,

PermalinkReply byAdnan AlionJanuary 18, 2014 at 8:57am

thankx

PermalinkReply by°ƻαɦɾα Şɧαɱsɧαɗ°onJanuary 21, 2014 at 7:33pm

1.

The main reason of using heap in priority queue is
improve performance
code is readable
less code
heap can't be used in priority queues

2.

We implement the heap by______
Threaded Tree
AVL tree
Complete binary tree
Expression

3.

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(n2) 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(n3) time, because the worst case has really random input which takes longer to.

4.

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

25

35
50

5.

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

Each list Sicontains the special keys + infinity and - infinity.

List S0contains the keys of S in non-decreasing order.

Each list is a subsequence of the previous one.

List Shcontains only the n special keys.

6.

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.

7.

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

Reflexivity
Symmetry
Transitivity

8.

The expression if ( ! heap->isEmpty() ) checks

Heap is empty

Heap is full

Heap is not empty

Not a valid expression (not confirm)

9.

We implement the heap by

Threaded Tree
AVL tree
Complete binary tree
Expression

10.

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.

Which property of relation is satisdied if we say: Ahmad R(is related to)Ahmad
Reflexivity
Symmetry
Transitvity
All of the given
Heap can be use to implement
Stack
Link list
Queue
Priority Queue
Which one of the following is not true regarding skip list.
Each list Si contain the special key + infinity and –infinity
List SO contain the key of S is non-decreasing order
List Sh contain only the n special keys
Each list in a sub sequence of previous list one
If Ahmad is cousin of Ali and Ali is cousin of Asad then Ahmad is also cousin of Asad
the statement has the following property.
Reflexivity
Symmetry
Transitivity
All of the above
The expression of (! heap-> is full() ) check
Heap is empty
Heap is full
Heap is not empty
Heap is not full(not conferm)
Which one of the following is not the property of equivalence relation
Reflexive
Symmetric
Transitive
Associative
Which of the following is not and implementation of table ADT
Sorted sequentially array
Stack
Link list
Skip list
Which one of the following is not an open addressing technique to resolve collection
Quadratic probing
Double hashing
Cubic probing
Liner probing
What is the best definition of a collision on a hash table?
Two entries are identical except for their keys.
Two entries with different data have the exact same key.
Two entries with different keys have the exact has value
Two entries with the exact same keys have different hash value.

PermalinkReply by°ƻαɦɾα Şɧαɱsɧαɗ°onJanuary 22, 2014 at 11:46am

A binary relation R over S is called an equivalence relation if it has following property(s)
Reflexivity
Symmetry
Transitivity
All of the given options
The preculateDown procedure will move the smaller value____ and bigger value______.
left,right
right,left
up,down
down,up
If the height of a perfect binary tree is 4. What will be the total number of nodes in it?
15
16
31
32
Which one of the following is NOT the property of equivalence relation?
Reflexive
Symmetric
Transitive
Associative
Which of the following heap method lowers the value of key at position ‘p’ by the amount ‘delta’?
Select correct option:
increaseKey(p,delta)
decreaseKey(p,delta)
preculateDown(p,delta)
remove(p,delta)
heap can be used to implement
stack
linked list
queue
priorty queue
which of following method is helpful in creating heap at once
insert
add
pecular down
update

PermalinkReply by°ƻαɦɾα Şɧαɱsɧαɗ°onJanuary 22, 2014 at 11:52am

The preculateDown procedure will move the smallervalue____ and bigger value______.
Select correct option:
left,right
right,left
up,down
down,up
There are ______cases of Rotation in AVLtree.
Select correct option:
2
3
4
5
.
A complete binary tree of height 3 has between ______nodes.
Select correct option:
8 to 14
8 to 15
8 to 16
8 to 17
In case of insertion of right inner node in BST,
Select correct option:
we need to apply single left rotation to make it AVL tree.
we need to apply single right rotationto make it AVL tree.
single left rotation first and then single right rotation tomake it AVL tree.
single right rotation first and then single left
Binary Search Tree voilates the condition of AVL tree when anynode has balance equal to
Select correct option:
2 or -2
1 or -1
0
None of the options.
Suppose we have the following values to be inserted inconstructing AVL tree, 20,23,25,10,12,13 Tell when first rotationwill take place,
Select correct option:
after inserting node 25
after inserting node 23
after inserting node 10
after inserting node 12

PermalinkReply byM.Tariq MalikonJanuary 22, 2014 at 6:01pm

Which of the following statement concerning heaps is NOT true?
Select correct option:

We implement the heap by ______.
Select correct option:
complete binary tree
While building Huffman encoding tree the new node that is the result of joining two nodes has the frequency.
Select correct option:
sum of frequency of both children nodes

The statement "The insertion operation in avl tree, generally take's more time than insertion operation in simple binary search tree" is
Select correct option:
Is always incorrect

In which case of insertion single rotation can make the AVL tree balanced.
Select correct option:
none of the given

If the bottom level of a binary tree is NOT completely filled, depicts that the tree is NOT a ------
Select correct option:
complete binary tree

A Threaded Binary Tree is a binary tree in which every node that does not have a right child has a THREAD (in actual sense, a link) to its ______successor
Select correct option:
inorder

If there are 23 external nodes in a binary tree then what will be the no. of internal nodes in this binary tree?
Select correct option:
22

Which one of the following traversals give the mathematical expression of an expression tree,
Select correct option:
inorder

PermalinkReply byM.Tariq MalikonJanuary 22, 2014 at 6:01pm

PermalinkReply byM.Tariq MalikonJanuary 22, 2014 at 6:02pm

PermalinkReply byM.Tariq MalikonJanuary 22, 2014 at 6:02pm

1.

The main reason of using heap in priority queue is
improve performance
code is readable
less code
heap can't be used in priority queues

2.

We implement the heap by ______
Threaded Tree
AVL tree
Complete binary tree
Expression

3.

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(n2) 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(n3) time, because the worst case has really random input which takes longer to.

4.

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

25

35
50

5.

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

Each list Si contains the special keys + infinity and - infinity.

List S0 contains the keys of S in non-decreasing order.

Each list is a subsequence of the previous one.

List Sh contains only the n special keys.

6.

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.

7.

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

Reflexivity
Symmetry
Transitivity

8.

The expression if ( ! heap->isEmpty() ) checks

Heap is empty

Heap is full

Heap is not empty

Not a valid expression (not confirm)

9.

We implement the heap by

Threaded Tree
AVL tree
Complete binary tree
Expression

10.

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.

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

Reflexivity

Symmetry
Transitvity
All of the given
Heap can be use to implement

Stack
Link list
Queue

Priority Queue
Which one of the following is not true regarding skip list.

Each list Si contain the special key + infinity and –infinity

List SO contain the key of S is non-decreasing order
List Sh contain only the n special keys

Each list in a sub sequence of previous list on
If Ahmad is cousin of Ali and Ali is cousin of Asad then Ahmad is also cousin of Asad
the statement has the following property.
Reflexivity
Symmetry
Transitivity
All of the above

The expression of (! heap-> is full() ) check

Heap is empty
Heap is full
Heap is not empty

Heap is not full(not conferm)

Which one of the following is not the property of equivalence relation

Reflexive

Symmetric

Transitive
Associative

Which of the following is not and implementation of table A

Sorted sequentially array
Stack
Link list
Skip list

Which one of the following is not an open addressing technique to resolve collection
Quadratic probing

Double hashing

Cubic probing

Liner probing

What is the best definition of a collision on a hash table?

Two entries are identical except for their keys.

Two entries with different data have the exact same key.

Two entries with different keys have the exact has value

Two entries with the exact same keys have different hash value.

PermalinkReply byM.Tariq MalikonJanuary 22, 2014 at 6:02pm

Dear Student,

We are going to extend the due date of quiz 3. Please keep eyes on announcements. Thanks

bY CS301 Instructor