Worksheetsdata structures mcq1
Total questions: 45
Worksheet time: 30mins
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
Process of inserting an element in stack is called ____________
Create
Push
Evaluation
Pop
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
To represent hierarchical relationship between elements, Which data structure is suitable?
Dequeue
Priority
Tree
Graph
Example of linear data structure except
array
tree
queue
stack
LIFO stands for
List of Outputs
Last in First Out
First in Last Out
None of them
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
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
the starting node in a rooted tree structure from which all other nodes branch off./
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
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
Given a sequence of number below:
50,60,40,70,45,55,30,80,65,35,25,75,85
When creating a binary search tree, what is the height of the tree?
3
4
5
6
In stack insertion and deletion can take place only at one end call the ____________________ of the stack.
Path
Function
Top
Bottom
How do you call this special function that is used to map a given value with a particular key for faster access of elements?
merge
sorted array
hash
bubble
Which value is assigned/set at front and rear ends during the Initialization of a Queue?
a. 0
b. 1
c. - 1
d. infinity
Which of the following is useful in traversing a given graph by breadth first search?
Op 1: stack
Op 2: set
Op 3: list
Op 4: queue
Which of the following abstract data types can be used to represent a many to-many relation?
Op 1: Tree
Op 2: Stack
Op 3: Graph
Op 4: Queue
The post fix form of (A + B) *C is
AB+ C*
ABC*+
ABC*+
ABC*+
Which one of the following is an application of Stack Data Structure?
Managing function calls
Arithmetic expression evaluation
CPU Scheduling
All of the above
The prefix form of A-B/ (C * D ^ E) is?
-/*^ACBDE
-ABCD*^DE
-A/B*C^DE
-A/BC*^DE
What is An Array ?
Named Collection of Homogeneous Data Element with unique Index for each element .
collection of data elements .
Named Collection of Data Elements Stored on Secondary Storage.
Data stored in a fashion that first inserted value will be deleted always first.
Efficiency of an algorithm is measured by
Time and Capacity complexity
Time and Space complexity
Speed and Space complexity
Speed and Capacity complexity
Types of data structures are ...
Primitive and non-primitive.
Linear and non-linear.
Static and dynamic.
All above
A data structure that changes in size as a program needs it by allocating and de-allocating memory is about ...
Static data structures
Dynamic data structues
Identify the INCORRECT statement about searching
i. Binary search starts by testing the largest data
ii. Linear search can be done for unsorted data only
iii. Linear search starts by testing data at the middle of list
iv. Binary search can be done for sorted homogeneous data
i, ii and iii
ii, iii and iv
i, iii and iv
i, ii, iii and iv
Suppose a list is {2, 9, 5, 4, 8, 1}. After the first phase of bubble sort, the list becomes …
2, 9, 5, 4, 8, 1
2, 9, 5, 4, 1, 8
2, 5, 9, 4, 8, 1
2, 5, 4, 8, 1, 9
The worst case occurs in linear search algorithm when ______________________
Item is not in the array at all
Item is somewhere in the middle of the array
Item is the last element in the array or item is not there at all
Item is the last element in the array
With a data set of 0,1,3,6,7,8,9
How many steps would a binary search take to find the value 8?
2
4
3
7
Identify the sorting algorithm that apply divide-and-conquer method.
Linear Sort
Merge Sort
Heap Sort
Binary Sort
Which of the following is not a collision resolution technique?
Separate chaining
Linear probing
Quadratic probing
Hashing
Given the following input (4322, 1334, 1471, 9679, 1989, 6171, 6173, 4199) and the hash function x mod 10, which of the following statements are true?
i. 9679, 1989, 4199 hash to the same value
ii. 1471, 6171 has to the same value
iii. All elements hash to the same value
iv. Each element hashes to a different value
i only
ii only
i and ii only
iii or iv
What is the advantage of using a doubly linked list for chaining over singly linked list?
it takes less memory
it is easy to implement
it makes the process of insertion and deletion faster
it causes less collisions
A hash function h defined h(key)=key mod 7, with linear probing, is used to insert the keys 44, 45, 79, 55, 91, 18, 63 into a table indexed from 0 to 6. What will be the location of key 18?
3
4
5
6
