NEW
Font size
WorksheetsData Structures
Total questions: 50
Worksheet time: 50mins
If the insertion and deletion happens from both the ends then the queue is called a______Queue
a) Deque
b) Header
c) Queue
d) Circular Queue
Entries in a stack are “ordered”. What is the meaning of this statement?
A collection of stacks is sortable
Stack entries may be compared with the ‘<‘ operation
The entries are stored in a linked list
There is a Sequential entry that is one by one
Which of the following applications may use a stack?
a) A parentheses balancing program
b) Tracking of local variables at run time
c) Compiler Syntax Analyzer
d) Data Transfer between two asynchronous process
What is the value of the postfix expression 6 3 2 4 + – *:
1
14
74
-18
The data structure required to check whether an expression contains balanced parenthesis is?
a) Stack
b) Queue
c) Array
d) Tree
Circular Queue is also known as ________
a) Ring Buffer
b) Square Buffer
c) Rectangle Buffer
d) Curve Buffer
If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed?
a) ABCD
b) DCBA
c) DCAB
d) ABDC
What does the following function do for a given Linked List with first node as head?
void fun1(struct node* head)
{
if(head == NULL)
return;
fun1(head->next);
printf("%d ", head->data);
}
a) Prints all nodes of linked lists
b) Prints all nodes of linked list in reverse order
c) Prints alternate nodes of Linked List
d) Prints alternate nodes in reverse order
Linked list data structure offers considerable saving in _____________
a) Computational Time
b) Space Utilization
c) Space Utilization and Computational Time
d) Speed Utilization
What would be the solution to the given prefix notation?
2
5
7
10
To represent hierarchical relationship between elements, Which data structure is suitable?
Dequeue
Priority
Tree
Graph
Match the following.
a) Completeness i) How long does it take to find a solution
b) Time Complexity ii) How much memory need to perform the search.
c) Space Complexity iii) Is the strategy guaranteed to find the solution when there in one.
a-iii, b-ii, c-i
a-i, b-ii, c-iii
a-iii, b-i, c-ii
a-i, b-iii, c-ii
___________ is neither an algorithm nor a program.
a.Computing
b.Pseudo code
c.Computer science
d.None of the above
Efficiency of an algorithm is measured by
Time and Capacity complexity
Time and Space complexity
Speed and Space complexity
Speed and Capacity complexity
If for an algorithm time complexity is given by O(1) then complexityof it is:
A. constant
B. polynomial
C. exponential
D. none of the mentioned
If for an algorithm time complexity is given by O(n) then complexityof it is:
A. constant
B. linear
C. exponential
D. none of the mentioned
What is the value of the ROOT node in this Tree?
35
24
42
20
Root
data structure similar to a graph, with no loops.
an object in a graph also known as a vertex
a join of relationship between nodes - also know as an arc
the starting node in a rooted tree structure from which all other nodes branch off./
Binary TREE
data structure similar to a graph, with no loops.
an object in a graph also known as a vertex
a join of relationship between nodes - also know as an arc
a tree where each node can only have 2 child nodes attached to it
In preorder traversal of a binary tree the second step is ____________
traverse the right subtree
traverse the left subtree
traverse right subtree and visit the root
visit the root
The decision tree structure begins at a node called the _____.
span
top
root
branch
How many leaf are there in the tree?
1
3
4
7
Which of these tree traversal methods is used to output the contents of a binary tree in ascending order?
Pre-Order
In-Order
Post-Order
Monastic Orders
In this tree, where would the new value "7" be placed?
On the left "leaf" of "4"
On the right "leaf" of "6"
On the left "leaf" of "15"
Over the top of the current number "5"
Which of these tree traversal methods is used to output the contents of a binary tree in ascending order?
Pre-Order
In-Order
Post-Order
Monastic Orders
A Data Structure is:
A C++ vector
A way of organizing, storing and performing operations on data.
A function in any programming language
A sequence of steps to solve a problem.
Example of linear data structure except
array
tree
queue
stack
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)
What kind of Data structure would you expect to find utilised to store operations in a CPU?
Stack
Queue
List
Tree
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
If a struct contains more than one pointer, what abstract data type is created?
a queue
a stack
a tree
a node
Which data structure is used for data that links arbitrarily, and includes things like loops?
binary trees
circular trees
graphs
dynamic linked stacks
Arranging the books in order and removing from the topmost book is an example for________
Linked List
Queue
Stack
Structure
What data structure can be used to check if a syntax has balanced paranthesis ?
Queue
Stack
List
Union
If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed?
ABCD
DCBA
DCAB
BADC
The operations performed by Stack are_____________
insert,delete
push,pop
add,delete
enqueue and dequeue
In ___________ type of linked lists we can traverse in both the directions.
Singly linked list
Circular linked list
One dimensional linked list
Doubly linked list
._____________ is a data structure in which every individual node consists of INFO to store data and LINK to store the address of the next node.
Queue
Stack
Singly Linked List
Circular queue
Which of the following principle does queue use?
LIFO
FIFO
Linear
Ordered
Which of the following points is/are true about Linked List data structure when it is compared with array
Arrays have better cache locality that can make them better in terms of performance.
It is easy to insert and delete elements in Linked List
Random access is not allowed in a typical implementation of Linked Lists
The size of array has to be pre-decided, linked lists can change their size any time.
All of the above
Which of the following is not a disadvantage to the usage of array?
Fixed size
There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
Insertion based on position
Accessing elements at specified positions
A variant of linked list in which last node of the list points to the first node of the list is?
Singly linked list
Doubly linked list
Circular linked list
void is __________ data type.
primary
derived
user defined
none of above
_____________ specifies how we enter data into our programs and what type of data we enter.
data type
data
datum
all of above
Pointer is __________ data type
derived
primary
user defined
none of above
