wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

special exam in DSA

Total questions: 60

Worksheet time: 20mins

Name
Class
Date
1.

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

(a)  

2.

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

(a)  

3.

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.

a)

Static or dynamic

b)

Linear or non-linear

c)

Homogeneous or non-homogeneous

4.

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

(a)  

5.

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)  

6.

This is a theoretical analysis of an algorithm.

a)

A Posterior Analysis

b)

A Priori Analysis

c)

A Pesterio Analysis

7.

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

(a)  

8.

Which of the following is a characteristic of an algorithm?

(a)  

9.

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

(a)  

10.

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

(a)  

11.

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

(a)  

12.

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

(a)  

13.

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

(a)  

14.

In a tree data structure, the top most node is called ___

a)

first node

b)

crown node

c)

root node

d)

apex node

15.

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)  

16.

It has branches - represents a hierarchical nature of a structure in a graphical form.

(a)  

17.

used for storing elements where each is a separate object.

a)

Priority Queue

b)

Linked-List

c)

Set

d)

Map

18.

a special type of queue where elements are processed based on their order (natural or custom).

a)

Set

b)

Map

c)

Priority Queue

d)

Linked-List

19.

consists of a set of vertices (or nodes) and a set of edges (relations) between the pairs of vertices.

(a)  

20.

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

21.

List of data in which element can be inserted and removed at the same end is called as (a)   .

22.

Efficiency of an algorithm is measured by

a)

Time and Capacity complexity

b)

Time and Space complexity

c)

Speed and Space complexity

d)

Speed and Capacity complexity

23.

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)

a)1

b)

b)2

c)

c)3

d)

d)4

24.

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

(a)  

25.

Data in the data structures are processed by operations like insertion, deletion, sorting, merging and ______________

a)

A. Traversing

b)

B. Searching

c)

C. Retrieval

d)

D. Both A and B

26.

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

27.

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)  

28.

The algorithm implemented in a stack is?

a)

FIFO- the first element must come out first from the list

b)

WIFI - the worst element must be the first to come in to the list

c)

LIFO - the last element must be the first to come out from the list

d)

all of the above

29.

Look at the diagram of the stack. What would the stack look like after the following operations were called:

peek()

pop()

push("yellow")

a)
b)
c)
d)
30.

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

a)

Algorithms

b)

Variables

c)

Data Types

d)

Programming

31.

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)  

32.

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)  

33.

In terms of an array, what is an index?

a)

he first element in an array

b)

A value which points to a data element in an array

c)

A list of all the elements in an array

34.

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

a)

1

b)

2

c)

3

d)

4

e)

5

35.

It use pointer to link nodes.

a)

Variable

b)

Trees

c)

Pointer

d)

Link List

36.

Why do we use the isFull() function in a queue?

a)

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)

B. to detect the size of the list then resize it when necessary to adjust the size of the queue

c)

both A and B

d)

no answer

37.

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

(a)  

38.

Act of adding values into a stack is called

(a)  

39.

In which of the following cases, binary search algorithm is used?​

a)

To search an element in an unordered list.​

b)

To search an element in a list of few elements.

c)

To search an element in any ordered list with large number of elements.​

40.
On average, which searching algorithm is more efficient?
a)
Binary Search
b)
Linear Search
41.

In Order traversal

a)

40 20 50 10 30

b)

40 50 20 30 10

c)

10 20 30 40 50

d)

50 40 20 30 10

42.
When deleting from a binary search tree, if the node being deleted has 2 children, we replace the entry with ____.
a)
the inorder successor
b)
null
c)
the left child
d)
the right child
e)
the parent
43.

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

44.

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

45.

A Binary Tree can have

a)

2 children

b)

1 child

c)

0 child

d)

all of the above

46.

Which of the following graph traversals closely imitates level order traversal of a binary tree?

a)

Depth First Search

b)

Breadth First Search

c)

Depth & Breadth First Search

d)

Binary Search

47.

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

48.

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 Orders

49.

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

50.

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

(a)  

51.

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

52.

In preorder traversal of a binary tree the second step is ____________

a)

traverse the right subtree

b)

traverse the left subtree

c)

traverse right subtree and visit the root

d)

visit the root

53.

How many leaf are there in the tree?

a)

1

b)

3

c)

4

d)

7

54.
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"
55.

What are the 3 depth traversals for a tree data structure?

a)

Pre-, In- and Post-order

b)

Pro-, In- and Past-order

c)

Pre-, Out- and Post-order

d)

Pre-, In- and New-order

56.

When traversing a binary tree, which diagram is post-order?

a)
b)
c)
57.

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

58.

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

59.

How many leaf nodes are there?

(a)  

60.

A linear list in which each node has point to the predecessor and successors nodes is called ........

a)

singly linked list

b)

circular linked list

c)

doubly linked list

d)

linear linked list