The preculateDown procedure will move the smaller value____ and bigger value______.
left,right
right,left
up,down
down,up
left,right
right,left
up,down
down,up
What requirement is placed on an array, so that binary search may be used to locate an entry?
► The array elements must form a heap.
► The array must have at least 2 entries.
► The array must be sorted.
► The array’s size must be a power of two.
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
If there are N elements in an array then the number of maximum steps needed to find an element using Binary Search is _______ .
► N
► N2
► Nlog2N
► log2N
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)
Vukwl- Virtual Education Solution
heap can be used to implementstack
linked list
queue
priorty queue
which of following method is helpful in creating heap at once
insert
add
pecular down
update
Which of the following is NOT true regarding the maze generation?
Select correct option:
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.
Vukwl-Virtual Education Solution
Which of the following is NOT true regarding the maze generation?
Select correct option:
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
Do not remove a randomly chosen wall if the cells it separates are already in the same set
None of the given
Suppose there is an image segmented into pixels. Each pixel has _________ neighbour(s).
Select correct option:
0
4
8
16
Vukwl- Virtual Education Solution
Finding the minimum is easy; it is _____ of the min heap.
Select correct option:
Top
Left most child
Right most child
None of the given options.
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
8 to 15
8 to 16
8 to 17
Which of the following method is helpful in creating the heap at once?
insertaddupdate
The expression if ( ! heap->isEmpty() ) checks
Heap is emptyHeap is full
Heap is not empty
Not a valid expression (not confirm)
We implement the heap by
given the values are the array representation of heap; 12 23 26 31 34 44 56 64 78 100 What is the 5th smallest element in the given heap?
Select correct option:
31
34
44
56
Suppose there are a set of fruits and a set of vegetables. Both sets are ______________ sets.
Select correct option:
Disjoint
Subsets
Whole
Equal
The main reason of using heap in priority queue is
We implement the heap by ____________
Threaded Tree
AVL tree
Complete binary tree
Expression
AVL tree
Complete binary tree
Expression
In complete binary tree the bottom level is filled from ________.
► Left to right ► Right to left ► Not filled at all ► None of the given options
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(n3) time, because the worst case has really random input which takes longer to.
If we want to find median of 50 elements, then after applying buildHeap method, how many times deleteMinmethod will be called ?
Select correct option:5
25
35
50
Question No: 8 ( M - 1 ) .
Question No: 9 ( M - 1 ) .
25
35
50
An expression tree will always be a,
Complete binary tree
Heap AVL tree
Question No: 1 ( M - 1 ) .
A solution is said to be efficient if it solves the problem within its resource constraints i.e. hardware and time.
True
False
Question No: 2 ( M - 1 ) .
Which one of the following is known as "Last-In, First-Out" or LIFO Data Structure?
Linked List
Stack
Queue
Tree
Question No: 3 ( M - 1 ) .What will be postfix expression of the following infix expression?
Infix Expression : a+b*c-d
ab+c*d-
abc*+d-
abc+*d-
abcd+*-
Question No: 4 ( M - 1 ) .
For compiler a postfix expression is easier to evaluate than infix expression?
True
False
Question No: 5 ( M - 1 ) .
Consider the following pseudo code
declare a stack of characters
declare a stack of characters
while ( there are more characters in the word to read )
{
read a character
push the character on the stack
}
while ( the stack is not empty )
{
pop a character off the stack
write the character to the screen
}
What is written to the screen for the input "apples"?
{
read a character
push the character on the stack
}
while ( the stack is not empty )
{
pop a character off the stack
write the character to the screen
}
What is written to the screen for the input "apples"?
selpa
selppa
apples
aaappppplleess
Question No: 6 ( M - 1 ) .
Question No: 6 ( M - 1 ) .
Consider the following function:
void test_a(int n)
{
cout << n << " ";
if (n>0)
test_a(n-2);
}
What is printed by the call test_a(4)?
4 2
0 2 4
0 2
2 4
Question No: 7 ( M - 1 ) .
If there are N external nodes in a binary tree then what will be the no. of internal nodes in this binary tree?
N -1
N+1
N+2
N
Question No: 8 ( M - 1 ) .
If there are N internal nodes in a binary tree then what will be the no. of external nodes in this binary tree?
N -1
N
N +1
N +2
Question No: 9 ( M - 1 ) .
If we have 1000 sets each containing a single different person. Which of the following relation will be true on each set:
Reflexive
Symmetric
Transitive
Associative
Reflexive
Symmetric
Transitive
Associative
Question No: 11 ( M - 1 ) .
A binary tree of N nodes has _______.
Log10 N levels
Log2 N levels
N / 2 levels
N x 2 levels
Question No: 12 ( M - 1 ) .
The easiest case of deleting a node from BST is the case in which the node to be deleted ___________.
Is a leaf node
Has left subtree only
Has right subtree only
Has both left and right subtree
Question No: 16 ( M - 1 ) - Please choose one
We access elements in AVL Tree in,
► Linear way only
► Non Linear way only
► Both linear and non linear ways
► None of the given options.
Question No: 17 ( M - 2 )
AVL Tree is,
► Non Linear data structure
► Linear data structure
► Hybrid data structure (Mixture of Linear and Non Linear)
► None of the given options.
Question No: 18 ( M - 2 )
How we can delete a node with two Childs in a binary search tree using its right sub tree.
Question No: 19 ( M - 2 )
What is Function Call Stack Give short answer.
Question No: 20 ( M - 3 )
xplain the two cases in which we apply double rotation in an AVL tree.
Question No: 21 ( M - 3 )
Here is a small binary tree.
Write the order of the nodes visited in
- A Post-order traversal
- A level-order traversal
Question No: 22 vu zs ( M - 5 )
Please consider the following AVL tree.
- Insert new node 87 in this tree and make tree balance.
- Write balance factor of each node after and before inserting node 87.
Question No: 13 ( M - 1 ) .
If there are N elements in an array then the number of maximum steps needed to find an element using Binary Search is _______ .
N
N2
Nlog2N
log2N
Question No: 14 ( M - 1 ) .
Merge sort and quick sort both fall into the same category of sorting algorithms. What is this category?
O(nlogn) sorts
Interchange sort
Average time is quadratic
None of the given options.
Question No: 15 ( M - 1 ) .
If one pointer of the node in a binary tree is NULL then it will be a/an _______ .
External node
Root node
Inner node
Leaf node
Question No: 16 ( M - 1 ) .
We convert the ________ pointers of binary to threads in threaded binary tree.
Left
Right
NULL
None of the given options
Question No: 17 ( M - 1 ) .
If the bottom level of a binary tree is NOT completely filled, depicts that the tree is NOT a
Expression tree
Threaded binary tree
complete Binary tree
Perfectly complete Binary tree9
Question No: 18 ( M - 1 ) .
What is the best definition of a collision in 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 same exact hash value.
Which of the following heap method increase 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)
Select correct option:
increaseKey(p,delta)
decreaseKey(p,delta)
preculateDown(p,delta)
remove(p,delta)
Which of the following is a property of binary tree?A binary tree of N external nodes has N internal nodeA Binary tree of N internal nodes has N+1 external nodeA Binary tree of N external nodes has N+1 internal nodeA Binary tree of N internal has N-1 external node
In a threaded binary tree which nodes have NULL child pointers,
All leaf nodes
Nodes other then leaf nodes
Root Node
None of the nodes
All leaf nodes
Nodes other then leaf nodes
Root Node
None of the nodes
In threaded binary tree, the NULL pointers are replaced by the
preorder successor or predecessor
inorder successor or predecessor
postorder successor or predecessor
NULL pointers are not replaced
preorder successor or predecessor
inorder successor or predecessor
postorder successor or predecessor
NULL pointers are not replaced
A complete binary tree is a tree that is _______ filled, with the possible exception of the bottom level.
partially
completely
incompletely
partly
partially
completely
incompletely
partly
Which one of the following is TRUE about iteration?
Iterative function calls consumes a lot of memory
Threaded Binary Trees use the concept of iteration
Iteration extensively uses stack memory
Recursion is more efficient than iteration
Iterative function calls consumes a lot of memory
Threaded Binary Trees use the concept of iteration
Iteration extensively uses stack memory
Recursion is more efficient than iteration
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.
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 of the following statement concerning heaps is NOT true?
A heap can be stored in a binary search tree.
A heap can be stored in an array.
A heap can be used to implement a priority queue.
A heap can be used to sort data.
A heap can be stored in a binary search tree.
A heap can be stored in an array.
A heap can be used to implement a priority queue.
A heap can be used to sort data.
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.
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.
Do not remove a randomly chosen wall if the cells it separates are already in the same set.
Which property of equivalence relation is satisfied if we say: Ahmad R(is related to) Ahmad
Reflexivity
Symmetry
Transitivity
Symmetry
Transitivity
Expression
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.
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.