NEW
Font size
S
M
L
XL
WorksheetsVCE-ALPHA-22.11.2023-FN
Total questions: 15
Worksheet time: 15mins
Name
Class
Date
1.
What is a splay operation?
a)
moving parent node to down of child
b)
moving a node to root
c)
moving root to leaf
d)
removing leaf node
2.
Which of the following options is an application of splay trees?
a)
cache Implementation
b)
networks
c)
send values
d)
receive values
3.
What are splay trees?
a)
self adjusting binary search trees
b)
self adjusting binary trees
c)
a tree with strings
d)
a tree with probability distributions
4.
Which of the following property of splay tree is correct?
a)
it holds probability usage of the respective sub trees
b)
any sequence of j operations starting from an empty tree with h nodes at most, takes O(jlogh) time complexity
c)
sequence of operations with h nodes can take O(logh) time complexity
d)
splay trees are unstable trees
5.
Why to prefer splay trees?
a)
easier to program
b)
space efficiency
c)
easier to program and faster access to recently accessed items
d)
quick searching
6.
When we have red-black trees and AVL trees that can perform most of operations in logarithmic times, then what is the need for splay trees?
a)
no there is no special usage
b)
In real time it is estimated that 80% access is only to 20% data, hence most used ones must be easily available
c)
redblack and avl are not upto mark
d)
they are just another type of self balancing binary search trees
7.
Is it true that splay trees have O(logn) amortized complexity?
a)
true
b)
false
8.
What is the disadvantage of using splay trees?
a)
height of a splay tree can be linear when accessing elements in non-decreasing order.
b)
splay operations are difficult
c)
no significant disadvantage
d)
splay tree performs unnecessary splay when a node is only being read
9.
What does the other nodes of an expression tree(except leaves) contain?
a)
only operands
b)
only operators
c)
both operands and operators
d)
expression
10.
What are the operations that could be performed in O(logn) time complexity by red-black tree?
a)
insertion, deletion, finding predecessor, successor
b)
only insertion
c)
only finding predecessor, successor
d)
for sorting
11.
When to choose Red-Black tree, AVL tree and B-trees?
a)
many inserts, many searches and when managing more items respectively
b)
many searches, when managing more items respectively and many inserts respectively
c)
sorting, sorting and retrieval respectively
d)
retrieval, sorting and retrieval respectively
12.
Which of the following is an application of Red-black trees and why?
a)
used to store strings efficiently
b)
used to store integers efficiently
c)
can be used in process schedulers, maps, sets
d)
for efficient sorting
13.
When it would be optimal to prefer Red-black trees over AVL trees?
a)
when there are more insertions or deletions
b)
when more search is needed
c)
when tree must be balanced
d)
when log(nodes) time complexity is needed
14.
What is the below pseudo code trying to do, where pt is a node pointer and root pointer?
redblack(Node root, Node pt) :
if (root == NULL)
return pt
if (pt.data < root.data)
{
root.left = redblack(root.left, pt);
root.left.parent = root
}
else if (pt.data > root.data)
{
root.right = redblackt(root.right, pt)
root.right.parent = root
}
return root
a)
insert a new node
b)
delete a node
c)
search a node
d)
count the number of nodes
15.
Why Red-black trees are preferred over hash tables though hash tables have constant time complexity?
a)
no they are not preferred
b)
because of resizing issues of hash table and better ordering in redblack trees
c)
because they can be implemented using trees
d)
because they are balanced
Reset
