Question No: 1 ( Marks: 1 ) - Please choose o
Which one of the following operations returns top value of the stack?
► Push
► Pop
► Top
► First
Question No: 2 ( Marks: 1 ) - Please choose one
Compiler uses which one of the following in Function calls,
► Stack
► Queue
► Binary Search Tree
► AVL Tree
Question No: 3 ( Marks: 1 ) - Please choose one
Every AVL is _________________
► Binary Tree
► Complete Binary Tree
► None of these
► Binary Search Tree
Question No: 4 ( Marks: 1 ) - Please choose one
If there are 56 internal nodes in a binary tree then how many external nodes this binary tree will have?
► 54
► 55
► 56
► 57
Question No: 5 ( Marks: 1 ) - Please choose one
If there are 23 external nodes in a binary tree then what will be the no. of internal nodes in this binary tree?
► 23
► 24
► 21
► 22
Question No: 6 ( Marks: 1 ) - Please choose one
Which one of the following is not an example of equivalence relation?
► Electrical connectivity
► Set of people
► <= relation
► Set of pixels
Question No: 7 ( Marks: 1 ) - Please choose one
Binary Search is an algorithm of searching, used with the ______ data.
► Sorted
► Unsorted
► Heterogeneous
► Random
Question No: 8 ( Marks: 1 ) - Please choose one
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.
Question No: 9 ( Marks: 1 ) - Please choose one
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
sort.
Question No: 10 ( Marks: 1 ) - Please choose one
Which of the following is a property of binary tree?
► A binary tree of N external nodes has N internal node.
► A binary tree of N internal nodes has N+ 1 external node.
► A binary tree of N external nodes has N+ 1 internal node.
► A binary tree of N internal nodes has N- 1 external node.
Question No: 11 ( Marks: 1 ) - Please choose one
By using __________we avoid the recursive method of traversing a Tree, which makes use of stacks and consumes a lot of memory and time.
► Binary tree only
► Threaded binary tree
► Heap data structure
► Huffman encoding
Question No: 12 ( Marks: 1 ) - Please choose one
Which of the following statement is true about dummy node of threaded binary tree?
► This dummy node never has a value.
► This dummy node has always some dummy value.
► This dummy node has either no value or some dummy value.
► This dummy node has always some integer value.
Question No: 13 ( Marks: 1 ) - Please choose one
For a perfect binary tree of height h, having N nodes, the sum of heights of nodes is
► N – (h – 1)
► N – (h + 1)
► N – 1
► N – 1 + h
Question No: 14 ( Marks: 1 ) - Please choose one
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.
► Two entries with the exact same key have different hash values.
Question No: 15 ( Marks: 1 ) - Please choose one
Which formula is the best approximation for the depth of a heap with n nodes?
► log (base 2) of n
► The number of digits in n (base 10), e.g., 145 has three digits
► The square root of n
► n
Question No: 16 ( Marks: 1 ) - Please choose one
Which of the following statement is NOT correct about find operation:
► It is not a requirement that a find operation returns any specific name, just that finds on two elements return the same answer if and only if they are in the same set.
► One idea might be to use a tree to represent each set, since each element in a tree has the same root, thus the root can be used to name the set.
► Initially each set contains one element.
► Initially each set contains one element and it does not make sense to make a tree of one node only.
Question No: 17 ( Marks: 1 ) - Please choose one
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 No: 18 ( Marks: 1 ) - Please choose one
In threaded binary tree the NULL pointers are replaced by ,
► preorder successor or predecessor
► inorder successor or predecessor
► postorder successor or predecessor
► NULL pointers are not replaced
Question No: 19 ( Marks: 1 ) - Please choose one
Which of the given option is NOT a factor in Union by Size:
► Maintain sizes (number of nodes) of all trees, and during union.
► Make smaller tree, the subtree of the larger one.
► Make the larger tree, the subtree of the smaller one.
► Implementation: for each root node i, instead of setting parent[i] to -1, set it to -k if tree rooted at i has k nodes.
Question No: 20 ( Marks: 1 ) - Please choose one
Suppose we had a hash table whose hash function is “n % 12”, if the number 35 is already in the hash table, which of the following numbers would cause a collision?
► 144
► 145
► 143
► 148
Question No: 21 ( Marks: 1 ) - Please choose o
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
Question No: 22 ( Marks: 1 ) - Please choose one
A binary tree with 24 internal nodes has ______ external nodes.
► 22
► 23
► 48
► 25
Question No: 23 ( Marks: 1 ) - Please choose on
In case of deleting a node from AVL tree, rotation could be prolong to the root node.
► Yes
► No
Question No: 24 ( Marks: 1 ) - Please choose one
when we have declared the size of the array, it is not possible to increase or decrease it during the ________of the program.
► Declaration
► Execution
► Defining
► None of the abov
Question No: 25 ( Marks: 1 ) - Please choose one
it will be efficient to place stack elements at the start of the list because insertion and removal take _______time.
► Variable
► Constant
► Inconsistent
► None of the above
Question No: 26 ( Marks: 1 ) - Please choose one
_______ is the stack characteristic but _______was implemented because of the size limitation of the array.
► isFull(),isEmpty()
► pop(), push()
► isEmpty() , isFull()
► push(),pop()
The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal
A:ABFCDE
B:ADBFEC
C:ABDECF
D:ABDCEF
If the height of a perfect binary tree is 5. What will be the total number of nodes in it?
Select correct option:
15
16
31
32
which one is not the property of binary tree
Internal nodes
External nodes
Binary tree whose every node has either zero or two children is called
Extended binary tree
Complete binary tree
Binary screech tree
None of above
In which of the following functions, the value of variable cannot be changed in function body?
Select correct option:
int cube( int num)
int cube(int& num)
int cube(const int& num)
int cube(int* num)
Quiz Start Time: 05:55 PM
Time Left 24
sec(s)
Question # 6of 10 ( Start time: 06:01:44 PM) Total Marks: 1
Identify the data structure which allows deletions at both ends of the list but insertion at only one end.
Select correct option:
Input-restricted deque
Output-restricted deque
Priority queues
None of above
Quiz Start Time: 05:55 PM
Time Left 27
sec(s)
Question # 7 of 10 ( Start time: 06:03:08 PM ) Total Marks: 1
In which traversal method, the recursive calls can be used to traverse a binary tree ?
Select correct option:
In preorder traversal only
In inorder traversal only
In postorder traversal only
All of the given options
Quiz Start Time: 05:55 PM
Time Left 29
sec(s)
Question # 8 of 10 ( Start time: 06:04:35 PM ) Total Marks: 1
Deleting a _____ node in BST is a _______ case
Select correct option:
Root, simplest
Left child, simplest
Right child, simplest
Leaf, simplest Ans
Quiz Start Time: 05:55 PM
Time Left 39
sec(s)
Question # 9 of 10 ( Start time: 06:06:04 PM ) Total Marks: 1
A BST generated from the data in ascending order is ____________.
Select correct option:
Linear
Nonlinear
Balanced
Un sorted
Quiz Start Time: 05:55 PM
Time Left 44
sec(s)
Question # 10 of 10 ( Start time: 06:07:05 PM ) Total Marks: 1
Which one is not the property of binary tree?
Select correct option:
Every node in binary tree should have maximum two children.
Only one node should have two parents.
Sibling nodes should have same parent.
None of given options.
1. Which data structure allows deleting data elements from front and inserting at rear?
b. Queues
2. Identify the data structure which allows deletions at both ends of the list but insertion at only one end.
a. Input-restricted deque
3. Which of the following data structure is non-linear type?
d. None of above
4. Which of the following data structure is linear type?
d. All of above
5. To represent hierarchical relationship between elements, which data structure is suitable?
c. Tree
6. A binary tree whose every node has either zero or two children is called
c. Extended binary tree
7. The depth of a complete binary tree is given by
d. Dn = log2n + 1
8. When representing any algebraic expression E which uses only binary operations in a 2-tree,
a. the variable in E will appear as external nodes and operations in internal nodes
9. A binary tree can easily be converted into q 2-tree
d. by replacing each empty sub tree by a new external node
10. When converting binary tree into extended binary tree, all the original nodes in binary tree are
a. internal nodes on extended tree
11. The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal
c. ABDECF
12. Which of the following sorting algorithm is of divide-and-conquer type?
c. Quick sort
13. An algorithm that calls itself directly or indirectly is known as
b. Recursion
14. In a binary tree, certain null entries are replaced by special pointers which point to nodes higher in the tree for efficiency. These special pointers are called
d. thread
15. The in order traversal of tree will yield a sorted listing of elements of tree in
b. Binary search trees
16. In a Heap tree
b. Values in a node is greater than every value in children of it
17. In a graph if e=[u, v], Then u and v are called
d. all of above
18. A connected graph T without any cycles is called
d. All of above
19. In a graph if e=(u, v) means
d. both b and c
Which property of relation is satisfied if we say: Ahmad R(is related to)Ahmad
Reflexivity correct
Symmetry
Transitvity
All of the given
Heap can be use to implement
Stack
Link list
Queue
Prioity Queue correct
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 correct
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 correct
Which one of the following is not the property of equivalence relation
Reflexive
Symmetric
Transitive
Associative correct
Which of the following is not and implementation of table ADT
Sorted sequentially array
Stack
Link list
Skip list correct
Which one of the following is not an open addressing technique to resolve collection
Quadratic probing
Double hashing
Cubic probing correct
Liner probing
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
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 treeExpression
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.