wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Data Structures

Total questions: 50

Worksheet time: 50mins

Name
Class
Date
1.

If the insertion and deletion happens from both the ends then the queue is called a______Queue

a)

a) Deque

b)

b) Header

c)

c) Queue

d)

d) Circular Queue

2.

Entries in a stack are “ordered”. What is the meaning of this statement?

a)

A collection of stacks is sortable

b)

Stack entries may be compared with the ‘<‘ operation

c)

The entries are stored in a linked list

d)

There is a Sequential entry that is one by one

3.

Which of the following applications may use a stack?

a)

a) A parentheses balancing program

b)

b) Tracking of local variables at run time

c)

c) Compiler Syntax Analyzer

d)

d) Data Transfer between two asynchronous process

4.

What is the value of the postfix expression 6 3 2 4 + – *:

a)

1

b)

14

c)

74

d)

-18

5.

The data structure required to check whether an expression contains balanced parenthesis is?

a)

a) Stack

b)

b) Queue

c)

c) Array

d)

d) Tree

6.

Circular Queue is also known as ________

a)

a) Ring Buffer

b)

b) Square Buffer

c)

c) Rectangle Buffer

d)

d) Curve Buffer

7.

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)

a) ABCD

b)

b) DCBA

c)

c) DCAB

d)

d) ABDC

8.

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)

a) Prints all nodes of linked lists

b)

b) Prints all nodes of linked list in reverse order

c)

c) Prints alternate nodes of Linked List

d)

d) Prints alternate nodes in reverse order

9.

Linked list data structure offers considerable saving in _____________

a)

a) Computational Time

b)

b) Space Utilization

c)

c) Space Utilization and Computational Time

d)

d) Speed Utilization

10.

What would be the solution to the given prefix notation?

a)

2

b)

5

c)

7

d)

10

11.

To represent hierarchical relationship between elements, Which data structure is suitable?

a)

Dequeue

b)

Priority

c)

Tree

d)

Graph

12.

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)

a-iii, b-ii, c-i

b)

a-i, b-ii, c-iii

c)

a-iii, b-i, c-ii

d)

a-i, b-iii, c-ii

13.

___________ is neither an algorithm nor a program.

a)

a.Computing

b)

b.Pseudo code

c)

c.Computer science

d)

d.None of the above

14.

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

15.

If for an algorithm time complexity is given by O(1) then complexityof it is:

a)

A. constant

b)

B. polynomial

c)

C. exponential

d)

D. none of the mentioned

16.

If for an algorithm time complexity is given by O(n) then complexityof it is:

a)

A. constant

b)

B. linear

c)

C. exponential

d)

D. none of the mentioned

17.
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
18.

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

a)

35

b)

24

c)

42

d)

20

19.

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./

20.

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

21.

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

22.

The decision tree structure begins at a node called the _____.

a)

span

b)

top

c)

root

d)

branch

23.

How many leaf are there in the tree?

a)

1

b)

3

c)

4

d)

7

24.

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

25.

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"

26.

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

27.

A Data Structure is:

a)

A C++ vector

b)

A way of organizing, storing and performing operations on data.

c)

A function in any programming language

d)

A sequence of steps to solve a problem.

28.

Example of linear data structure except

a)

array

b)

tree

c)

queue

d)

stack

29.
_________________ is a collection of elements used to store the same type of data.
a)
Array
b)
Switch
c)
Case
d)
Loop
30.

int nums[ ] =

{2, 3, 5, 8, 9, 11};

How would you access the fourth element in nums

a)

nums[8]

b)

nums[3]

c)

nums(4)

d)

nums(3)

31.
Which of the following is NOT a Type of Data Structures?
a)
Arrays
b)
Tables
c)
Stacks
d)
Trees
32.
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)
Algorithms
33.

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

34.

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?

a)

ABCD

b)

DCBA

c)

DCAB

d)

ABDC

35.

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

36.

If a struct contains more than one pointer, what abstract data type is created?

a)

a queue

b)

a stack

c)

a tree

d)

a node

37.

Which data structure is used for data that links arbitrarily, and includes things like loops?

a)

binary trees

b)

circular trees

c)

graphs

d)

dynamic linked stacks

38.

Arranging the books in order and removing from the topmost book is an example for________

a)

Linked List

b)

Queue

c)

Stack

d)

Structure

39.

What data structure can be used to check if a syntax has balanced paranthesis ?

a)

Queue

b)

Stack

c)

List

d)

Union

40.

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)

BADC

41.

The operations performed by Stack are_____________

a)

insert,delete

b)

push,pop

c)

add,delete

d)

enqueue and dequeue

42.

In ___________ type of linked lists we can traverse in both the directions.

a)

Singly linked list

b)

Circular linked list

c)

One dimensional linked list

d)

Doubly linked list

43.

._____________ 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.

a)

Queue

b)

Stack

c)

Singly Linked List

d)

Circular queue

44.

Which of the following principle does queue use?

a)

LIFO

b)

FIFO

c)

Linear

d)

Ordered

45.

Which of the following points is/are true about Linked List data structure when it is compared with array

a)

Arrays have better cache locality that can make them better in terms of performance.

b)

It is easy to insert and delete elements in Linked List

c)

Random access is not allowed in a typical implementation of Linked Lists

d)

The size of array has to be pre-decided, linked lists can change their size any time.

e)

All of the above

46.

Which of the following is not a disadvantage to the usage of array?

a)

Fixed size

b)

There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size

c)

Insertion based on position

d)

Accessing elements at specified positions

47.

A variant of linked list in which last node of the list points to the first node of the list is?

a)

Singly linked list

b)

Doubly linked list

c)

Circular linked list

48.

void is __________ data type.

a)

primary

b)

derived

c)

user defined

d)

none of above

49.

_____________ specifies how we enter data into our programs and what type of data we enter.

a)

data type

b)

data

c)

datum

d)

all of above

50.

Pointer is __________ data type

a)

derived

b)

primary

c)

user defined

d)

none of above