NEW
Font size
WorksheetsData Structures & Algorithm
Total questions: 40
Worksheet time: 22mins
Example of linear data structure except
array
tree
queue
stack
Which of these data structures is LIFO?
Stack
Queue
Binary Tree
Double linked list
int nums[ ] =
{2, 3, 5, 8, 9, 11};
How would you access the fourth element in nums
nums[8]
nums[3]
nums(4)
nums(3)
A FIFO structure implemented as a ring where the front and rear pointers can wrap around the end of the start of the array.
Linear Queue
Circular Queue
Priority Queue
It use pointer to link nodes.
Variable
Link List
Pointer
Trees
LIFO stands for
List of Outputs
Last in First Out
First in Last Out
None of them
Act of adding values into a stack is called
Popping
Polling
Pushing
None
If the elements “A”, “B”, “C” and “D” are placed in a stack and are deleted one at a time, in what order will they be removed?
ABCD
DCBA
DCAB
ABDC
Consider the following operation performed on a stack of size 5.
Push(1);
Pop();
Push(2);
Push(3);
Pop();
Push(4);
Pop();
Pop();
Push(5);
After the completion of all operation, get the total number of element present in stack is
1
2
3
4
int is __________ data type.
user defined
derived
primary
all of above
Array is ___________ data type.
user defined
primary
derived
all of above
In ____________ data structure, the data items are arranged in a linear sequence.
linear
non linear
both a and b
all of above
In ___________ data structure data items are not in sequence.
non linear
linear
non-homogeneous
all of above
Full form of LIFO is ____________
Last Inside First Outside
Last Innner First Outer
Last In First Out
Last Impact First Out
Every stack has a variable _________ associated with it.
TOP
BOT
POT
none of the above
_________ operation removes the element from the top of the stack.
push
pop
update
none of the above
A function calls itself is called ___________.
queue
recursion
function
none of above
The elements in a queue are added at one end called ________.
front
rear
near
none of above
A binary search tree whose left subtree and right subtree differ in height by at most 1 unit is called
AVL tree
Red-black tree
Lemma tree
None of the above
________is very useful in situation when data have to stored and then retrieved in reverse order.
Stack
Queue
List
Link list
In the __________traversal we process all of a vertex’s descendents before we move to an adjacent vertex.
Depth First
Breadth First
With First
Depth Limited
A graph is a collection of nodes, called __________ And line segments called arcs or__________ that connect pair of nodes.
vertices, edges
edges, vertices
vertices, paths
graph node, edges
A tree sort is also known as__________ sort.
quick
heap
shell
selection
A terminal node in a binary tree is called __________
Root
Branch
Child
Leaf
Other name for directed graph is _________
Direct graph
Digraph
Dir-graph
Dgraph
In a graph if E=(u,v) means _____________
u is adjacent to v but v is not adjacent to u
e begins at u and ends at v
u is processor and v is successor
both b and c
How many leaf are there in the tree?
1
3
4
7
What are the 3 depth traversals for a tree data structure?
Pre-, In- and Post-order
Pro-, In- and Past-order
Pre-, Out- and Post-order
Pre-, In- and New-order
The hash function is
H1(k) = k % 50.
In the case of collision, the hash function used is
H(k) = (H1(k) + M x H2(k)) % 50
where H1(k) = k % 50 and H2(k) = k % 20.
M is initialized to 0 and is incremented by 1 each time a collision occurs.
This could be categorized under which of the following collision detection technique
a)Linear Probing
b)quadratic Probing
c)Re-Hashing
d)Double Hashing
In a stack, if a user tries to remove an element from empty stack it is called
Underflow
Overflow
Garbage Collection
Empty collection
Complexity of Binary Search for an array of n numbers is
log2n
nlog2n
n2
n
Example of non linear data structure
Array
Tree
Queue
Stack
What is the data structure used to perform recursion?
Array
Stack
Queue
Linked list
The prefix form of A-B/ (C * D ^ E) is?
-/*^ACBDE
-ABCD*^DE
-A/B*C^DE
-A/BC*^DE
Which of the following data structures can be used for parentheses matching?
n-ary tree
priority queue
stack
queue
The examples of Linear Data Structures are
Stacks,Queues,Linked list
int,float,complex
Operators,tokens,punctuators
Tree, graph
