wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

super duper special exam in DSA

Total questions: 121

Worksheet time: 40mins

Name
Class
Date
1.
Which of the following is NOT a Type of Data Structures?
a)
Arrays
b)
Tables
c)
Stacks
d)
Trees
2.

It use pointer to link nodes.

(a)  

3.
What kind of Data structure would you expect to find utilised to store operations in a CPU?
a)
Stack
b)
Queue
c)
List
d)
Tree
4.

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

a)

1

b)

2

c)

3

d)

4

5.

int is __________ data type.

a)

user defined

b)

derived

c)

primary

d)

all of above

6.

Array is ___________ data type.

a)

user defined

b)

primary

c)

derived

d)

all of above

7.

In (a)   data structure, the data items are arranged in a linear sequence.

8.

In (a)   data structure data items are not in sequence.

9.

Every stack has a variable (a)   associated with it.

10.

A function calls itself is called (a)   .

11.

The elements in a queue are added at one end called ________.

a)

front

b)

rear

c)

near

d)

none of above

12.

________is very useful in situation when data have to stored and then retrieved in reverse order.

a)

Stack

b)

Queue

c)

List

d)

Link list

13.

In the __________traversal we process all of a vertex’s descendents before we move to an adjacent vertex.

a)

Depth First

b)

Breadth First

c)

With First

d)

Depth Limited

14.

A graph is a collection of nodes, called __________ And line segments called arcs or__________ that connect pair of nodes.

a)

vertices, edges

b)

edges, vertices

c)

vertices, paths

d)

graph node, edges

15.

A terminal node in a binary tree is called (a)  

16.

How many leaf are there in the tree?

(a)  

17.

Which of the following data structures can be used for parentheses matching?

a)

n-ary tree

b)

priority queue

c)

stack

d)

queue

18.

The examples of Linear Data Structures are

a)

Stacks,Queues,Linked list

b)

int,float,complex

c)

Operators,tokens,punctuators

d)

Tree, graph

19.
int nums[ ] =
{2, 3, 5, 8, 9, 11};
How would you access the fourth element in nums
a)
nums[4]
b)
nums[3]
c)
nums(4)
d)
nums(3)
20.
What would a dynamic data structure entail?
a)
Memory is allocated to the data structure as the program executes.
b)
Memory is allocated to the data structure at compile time.
c)
The size of the structure is fixed
d)
The data structure can also double as TNT
21.

A Queue can only store 6 data items. The Queue is sent 4 data items: Bert, Cynthia, Cedric and Albert. Where does the "Front" pointer point?

(a)  

22.

A Queue can only store 6 data items. The Queue is sent 4 data items: Bert, Cynthia, Cedric and Albert. Where does the "Rear" pointer point?

(a)  

23.

A Queue can only store 6 data items. The Queue is sent 4 data items: Bert, Cynthia, Cedric and Albert. Where does the "Rear" pointer point?

(a)  

24.

A Queue can only store 6 data items. The Queue is sent 4 data items: Bert, Cynthia, Cedric and Albert. Where does the "Front" pointer point if a deQueue operation is performed.

(a)  

25.

Which data structure cannot have elements of different data types?

(a)  

26.

Which of the following is not a valid array?

a)

names=("Tom","Ali","22","Connie")

b)

scores=(2,3,5,4,2,1)

c)

names=("Tom", "Ali", 22, "Connie")

27.

In terms of an array, what is an index?

a)

A value which points to a data element in an array

b)

The first element in an array

c)

A list of all the elements in an array

28.

Which is NOT an operation performed on a queue?

(a)  

29.

In a dynamic data structure where is the memory allocated from to hold the data structure?

a)

Heap

b)

Cache

c)

Secondary Storage

d)

ROM

e)

Virtual Memory

30.

A data structure which consists of a collection of elements, typically in fixed number and sequence and typically indexed by names.

a)

Array

b)

Record

c)

Queue

d)

List

e)

Stack

31.

Which of these data structures is LIFO?

a)

Stack

b)

Queue

c)

Binary Tree

d)

Double linked list

32.

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, what is the number of elements present on the stack

(a)  

33.

What method is used to return an element from a stack without removing it?

(a)  

34.

If the element "A B C D" are placed in a stack and are deleted one at a time

in what order will they be removed?

(a)  

35.

Storage for data defined in terms of set of operations to be performed on the data

a)

Arrays

b)

Variables

c)

Abstract Data Types

d)

Data Types

36.

Stack is also called as

(a)  

37.

In stack insertion and deletion can take place only at one end call the (a)   of the stack.

38.

The mechanism for passing parameters, return addresses and local variables is referred to as the (a)  

39.

A call stack is the mechanism for passing parameters, return addresses and global variables

a)

True

b)

False

40.

In which order are elements pushed onto the stack frame when a call is made?

a)

Parameters

Return Addresses

Local Variables

b)

Return Addresses

Local Variables

Parameters

c)

Local Variables

Return Addresses

Parameters

41.

An ADT gives you specific details on how it will run within a particular algorithm

a)

True

b)

False

42.

Which tree traversal method makes use of a stack?

a)

Depth-First

b)

Breadth-First

43.

The depth-first tree traversal method makes use of a stack

a)

True

b)

False

44.

Which of the following options refers to the mechanism itself for passing parameters, return addresses and local variables?

a)

Stack Frame

b)

Call Stack

45.

Which of the following options refers to the individual collections of pushed parameters, return addresses and local variables for each call?

a)

Stack Frame

b)

Call Stack

46.

A call stack may contain multiple stack frames

a)

True

b)

False

47.

Items are (a)   to the stack when a subroutine call is made

48.

Items are (a)   from the stack when a subroutine call is completed

49.

A data structure that can grow or shrink in size is referred to as being (a)  

50.

A data structure that cannot grow or shrink in size is referred to as being (a)  

51.

What are Stacks Used For?

a)

Type in data from keyboard

b)

To remove data

c)

To stack information

d)

To keep track of a sequence of operations

52.

Referring to a stack as FILO is equivalent to saying it is LIFO

a)

True

b)

False

53.

Inorder traversal

a)

Left Right Root

b)

Left Root Right

c)

Right Left Root

d)

Right Left Root

54.

In order traversal of the tree

a)

9 8 4 2 3 5 1

b)

4 9 8 5 2 3 1

c)

8 4 9 1 3 5 2

d)

8 9 4 3 2 5 1

55.

…………………. Is a directed tree in which out degree of each node is less than or equal to two.

a)

Binary tree

b)

AVL tree

c)

Trinary tree

d)

All the above

56.

Which of the following sequences denotes the post order traversal sequence of the tree?

a)

f e g c d b a

b)

g c b d a f e

c)

g c d b f e a

d)

f e d g c b a

57.

The number of edges from the node to the deepest leaf is called (a)   of the tree.

58.

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)  

59.
Enter Last Name, First Name,
4 lines
60.

1. The number of edges from the node to the deepest leaf is called (a)   of the tree.

61.

2. The number of edges from the root to the node is called (a)   of the tree.

62.
3. What is a complete binary tree?
a)
a) Each node has exactly zero or two children
b)
b) A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from right to left
c)
c) A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from left to right
d)
d) A tree In which all nodes have degree 2
63.
4. What is a full binary tree?
a)
a) Each node has exactly zero or two children
b)
b) Each node has exactly two children
c)
c) All the leaves are at the same level
d)
d) Each node has exactly one or two children
64.
5. Given a binary search tree, which traversal type would print the values in the nodes insorted order?
a)
a. Preorder
b)
B. Postorder
c)
C. Inorder
d)
D. None of the above
65.
6. Which of the following is not an advantage of trees?
a)
a) Hierarchical structure
b)
b) Faster search
c)
c) Router algorithms
d)
d) Undo/Redo operations in a notepad
66.
7. Which of the following statements about binary trees is NOT true?
a)
A. Every binary tree has at least one node.
b)
B. Every non-empty tree has exactly one root node.
c)
C. Every node has at most two children.
d)
D. Every non-root node has exactly one parent.
67.

8. What is the maximum number of children that a binary tree node can have?

(a)  

68.
9. How many common operations in a binary tree operations
a)
1
b)
2
c)
3
d)
4
69.

10. A tree is composed of (a)   connected by edges or lines.

70.
11. A Kind of tree where every node in a tree can have at most two children.
a)
Binary Tree
b)
Binary Expression Tree
c)
Tree
d)
Binary Search Tree
71.

12. What is the value of the ROOT node in this Tree?

(a)  

72.
13. Root
a)
data structure similar to a graph, with no loops.
b)
an object in a graph also known as a vertex
c)
a join of relationship between nodes - also know as an arc
d)
the starting node in a rooted tree structure from which all other nodes branch off./
73.
14. Binary TREE
a)
data structure similar to a graph, with no loops.
b)
an object in a graph also known as a vertex
c)
a join of relationship between nodes - also know as an arc
d)
a tree where each node can only have 2 child nodes attached to it
74.
15. Which of these tree traversal methods is used to output the contents of a binary tree in ascending order?
a)
Pre-Order
b)
In-Order
c)
Post-Order
d)
Monastic Order
75.
16. The decision tree structure begins at a node called the _____.
a)
span
b)
top
c)
root
d)
branch
76.

17. How many leaf are there in the tree?

(a)  

77.
18. In this tree, where would the new value "7" be placed?
a)
On the left "leaf" of "4"
b)
On the right "leaf" of "6"
c)
On the left "leaf" of "15"
d)
Over the top of the current number "5"
78.
19. 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?
a)
3
b)
4
c)
5
d)
6
79.
20. 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?
a)
5,15,27,34,47,54,63,70,72,75,83,85,88,94,99,101
b)
72,54,34,5,27,15,47,63,70,83,75,88,85,101,94,99
c)
15,27,5,47,34,70,63,54,75,85,99,94,101,88,83,72
d)
15,27,5,47,34,63,54,70,75,85,99,94,101,88,83,72
e)
none of the above
80.
21. A Balanced Tree has equal number of items on each subtree.
a)
True
b)
False
81.
22. Root has more left descendants than the right descendants or vice versa.
a)
Balanced Tree
b)
Perfect Tree
c)
Right Tree
d)
Unbalanced Tree
82.
23. Choose the correct statement
a)
A data structure is a specialised format for organising and storing data
b)
A data structure is a specialised format for organising and storing information
c)
A data structure is a format for organising and storing only one data type
d)
A data structure is too complicated to truly understand or use
83.
24. The number of edges from the root to the node is called __________ of the node.
a)
Height
b)
Length
c)
Path
d)
Depth
84.
25. In a full binary tree...........................
a)
Each level has exactly 0 or 2 nodes
b)
All the leaves are at the same level
c)
Each node has exactly zero or two children
d)
Each level has exactly 2 nodes
85.
26. 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.
a)
Binary Tree
b)
Binary Search Tree
c)
AVL Tree
d)
Binary Heap Tree
86.
27. The ____ of a Binary Search Tree starts by visiting the current node, then its left child node and then its right child node.
a)
Pre-Order Traversal
b)
In-Order Traversal
c)
Post-Order Traversal
d)
Linear Order Traversal
87.
28. Preorder of a binary tree with the following Postorder traversal: 1 3 5 4 2Inorder traversal: 1 2 3 4 5
a)
21435
b)
21453
c)
21354
88.
29.Consider a binary tree where A is the parent of B and C, B is a parent of D and E, E is a parent of F. G and H are children of C, and I and J are children of H.On what level is J?
a)
Level 0
b)
Level 1
c)
Level 2
d)
Level 3
89.
30. The number of edges from the root to the node is called __________ of the node.
a)
Depth
b)
Length
c)
Path
d)
Height
90.

31. It is a view or representation of an entity that includes only the most significant attributes

(a)  

91.

32. It is a specialized way of storing and organizing data in a computer so that it can be used efficiently.

(a)  

92.

33. It is a step by step process to solve a given problem. Take the simplest example below.

(a)  

93.

34. 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)  

94.

35. It is the process of arranging a list of elements in a particular order.

(a)  

95.

36. Data structures have fixed sizes, structures and memory locations at compile time.

(a)  

96.

37. Data structures have sizes, structures and memory locations that can shrink or expand depending on the use.

(a)  

97.

38. It is a linear data structure that stores a collection of elements. Operates on first in first out (FIFO) algorithm.

(a)  

98.

39. push() and pop() functions are found in..

(a)  

99.

40. Is a sequential collection of elements of the same data type. They are stored sequentially in memory.

(a)  

100.

41. Process of inserting an element in stack is called (a)  

101.

42. 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)  

102.

43. Which data structure allows deleting data elements from front and inserting from rear?

(a)  

103.

44. If the insertion and deletion happens from both the ends then the deletion is called a (a)  

104.

45. If the elements '1', '2', '3' and '4' are added in a stack, so what would be the order for the removal?

(a)  

105.

46. Act of adding values into a stack is called

(a)  

106.

47. On average, which searching algorithm is more efficient?

(a)  

107.

48. A tree is composed of (a)   connected by edges or lines.

108.

49. Which of these tree traversal methods is used to output the contents of a binary tree in ascending order?

(a)  

109.

50. Data that a variable can hold in a programming language, all programming language has a set of it.

(a)  

110.

51. It use pointer to link nodes.

(a)  

111.

52. (a)   is a pictorial representation of steps.

112.

53. (a)   is an artificial and informal language that helps programmers develop algorithms.

113.

54. What value is at index 1 in this array? String[] names = {"Mack", "Dennis", "Dee", "Charlie"};

(a)  

114.

55. Example of linear data structure except

(a)  

115.

56. What is the symbol for a decision in a flowchart?

(a)  

116.

57. True or false: Data structures are not a crucial part in data management.

(a)  

117.

58. At least one of this is produced by an algorithm.

(a)  

118.

59. Each instruction must be very basic, so the purpose of those instructions must be very clear to us.

(a)  

119.
60. The recursive algorithm to perform a pre-order traversal of a binary tree can be described simply as:
a)
Left pointer, right pointer, node
b)
Node, left pointer, right pointer
c)
Left pointer, node, right pointer
d)
120.
type your name
4 lines
121.
Quilgo Test ID
4 lines