Font size
Worksheetsspecial exam in DSA
Total questions: 60
Worksheet time: 20mins
It is a view or representation of an entity that includes only the most significant attributes
(a)
It is a specialized way of storing and organizing data in a computer so that it can be used efficiently.
(a)
This characteristic describes whether the data items are arranged in chronological sequence, such as with an array, or in an unordered sequence, such as with a graph.
Static or dynamic
Linear or non-linear
Homogeneous or non-homogeneous
It is a step by step process to solve a given problem. Take the simplest example below.
(a)
It is a method of solving problems that involves breaking a problem down into smaller and smaller sub problems until you get to a small enough problem that it can be solved trivially.
(a)
This is a theoretical analysis of an algorithm.
A Posterior Analysis
A Priori Analysis
A Pesterio Analysis
It is the process of arranging a list of elements in a particular order.
(a)
Which of the following is a characteristic of an algorithm?
(a)
Data structures have fixed sizes, structures and memory locations at compile time.
(a)
Data structures have sizes, structures and memory locations that can shrink or expand depending on the use.
(a)
It is a linear data structure that stores a collection of elements. Operates on first in first out (FIFO) algorithm.
(a)
push() and pop() functions are found in..
(a)
Is a sequential collection of elements of the same data type. They are stored sequentially in memory.
(a)
In a tree data structure, the top most node is called ___
first node
crown node
root node
apex node
A complete binary tree where the value of each of each parent node is either higher or lower than the value of its child nodes.
(a)
It has branches - represents a hierarchical nature of a structure in a graphical form.
(a)
used for storing elements where each is a separate object.
Priority Queue
Linked-List
Set
Map
a special type of queue where elements are processed based on their order (natural or custom).
Set
Map
Priority Queue
Linked-List
consists of a set of vertices (or nodes) and a set of edges (relations) between the pairs of vertices.
(a)
Process of inserting an element in stack is called (a)
List of data in which element can be inserted and removed at the same end is called as (a) .
Efficiency of an algorithm is measured by
Time and Capacity complexity
Time and Space complexity
Speed and Space complexity
Speed and Capacity complexity
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, the number of elements present in stack are
a)1
b)2
c)3
d)4
Which data structure allows deleting data elements from front and inserting from rear?
(a)
Data in the data structures are processed by operations like insertion, deletion, sorting, merging and ______________
A. Traversing
B. Searching
C. Retrieval
D. Both A and B
If the insertion and deletion happens from both the ends then the deletion is called a (a)
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)
The algorithm implemented in a stack is?
FIFO- the first element must come out first from the list
WIFI - the worst element must be the first to come in to the list
LIFO - the last element must be the first to come out from the list
all of the above
Look at the diagram of the stack. What would the stack look like after the following operations were called:
peek()
pop()
push("yellow")
Data that a variable can hold in a programming language, all programming language has a set of it.
Algorithms
Variables
Data Types
Programming
It can be used to encapsulate parts of an algorithm by localizing in one section of a program all the statements relevant to a certain aspect of a program.
(a)
A Queue can only store 6 data items. The Queue has sent 4 data items: Bert, Cynthia, Cedric and Albert. Where does the "Front" pointer point if a deQueue operation is performed.
(a)
In terms of an array, what is an index?
he first element in an array
A value which points to a data element in an array
A list of all the elements in an array
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, the no of element present on stack are
1
2
3
4
5
It use pointer to link nodes.
Variable
Trees
Pointer
Link List
Why do we use the isFull() function in a queue?
A. to identify if the list has any available position, so we can add if there is or send an overflow error message otherwise
B. to detect the size of the list then resize it when necessary to adjust the size of the queue
both A and B
no answer
If the elements '1', '2', '3' and '4' are added in a stack, so what would be the order for the removal?
(a)
Act of adding values into a stack is called
(a)
In which of the following cases, binary search algorithm is used?
To search an element in an unordered list.
To search an element in a list of few elements.
To search an element in any ordered list with large number of elements.
In Order traversal
40 20 50 10 30
40 50 20 30 10
10 20 30 40 50
50 40 20 30 10
In a ____, for any node 'n' every descendant node's value in the left subtree is less than n and in the right subtree is greater than n.
Binary Tree
Binary Search Tree
AVL Tree
Binary Heap Tree
The ____ of a Binary Search Tree starts by visiting the current node, then its left child node and then its right child node.
Pre-Order Traversal
In-Order Traversal
Post-Order Traversal
Linear Order Traversal
A Binary Tree can have
2 children
1 child
0 child
all of the above
Which of the following graph traversals closely imitates level order traversal of a binary tree?
Depth First Search
Breadth First Search
Depth & Breadth First Search
Binary Search
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
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 tree is composed of (a) connected by edges or lines.
What is the value of the ROOT node in this Tree?
(a)
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
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
When traversing a binary tree, which diagram is post-order?
Given a binary search tree, insert 27, 15, 63, 99, 70 and 85 (in this order) into the binary search tree. What is the post-order traversal?
5,15,27,34,47,54,63,70,72,75,83,85,88,94,99,101
72,54,34,5,27,15,47,63,70,83,75,88,85,101,94,99
15,27,5,47,34,70,63,54,75,85,99,94,101,88,83,72
15,27,5,47,34,63,54,70,75,85,99,94,101,88,83,72
none of the above
Which of the following sequences denotes the post order traversal sequence of the tree?
f e g c d b a
g c b d a f e
g c d b f e a
f e d g c b a
How many leaf nodes are there?
(a)
A linear list in which each node has point to the predecessor and successors nodes is called ........
singly linked list
circular linked list
doubly linked list
linear linked list
