wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

DAta Structure-unit 1&2

Total questions: 61

Worksheet time: 24mins

Name
Class
Date
1.

Myra is on a quest to find the correct term for the operation of processing each element in the list. What is it called?

a)

Sorting

b)

Merging

c)

Traversing

d)

Searching

2.

Which of the following is not a basic building block of programming?

a)

integer

b)

Arrays

c)

character

d)

Lists

e)

String

3.

Which data structure uses the Last In, First Out (LIFO) mechanism?

a)

Arrays

b)

Stacks

c)

Queues

d)

Linked List

4.

Which data structure uses the LIFO mechanism?

a)

Arrays

b)

Stacks

c)

Queues

d)

Linked List

5.

Avni, Neha, and Advait are playing a game where the element inserted first will be removed first in the (a)  

6.

Who will be the first to be kicked out of the game of musical chairs?

(a)  

7.

When Kabir attempts to remove an element from the empty stack, what is the situation called?

a)

Underflow

b)

Garbage collection

c)

Overflow

d)

None of the above

8.

Hey there! Can you tell me which of the following expressions is written in infix notation?

a)

ABC+*

b)

+A*BC

c)

A+B*C

d)

None of the above

9.

#define SIZE 11

void main()

{

int stack[SIZE];

int top=-1;

}


What is the magic number that keeps the stack happy and prevents overflow?

a)

8

b)

9

c)

11

d)

10

10.

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

a)

1324

b)

4321

c)

3241

d)

None of the above

11.

Shaan, Aisha, and Mira are playing a fun game with the following function.

int array()

{

if(isEmpty())

return 0;

else

{

int =q[front];

front++;

return n;

}

}


What operation does the above code perform?

a)

a. Enqueue

b)

b. Dequeue

c)

c. Return the front element

d)

d. add an element to front

e)

e. add an element to rear

12.

Hey there! Can you help Ishaan figure out the postfix expression for this cool infix expression?

A + B * C ^ D

a)

ABCD+*^

b)

ABCD*+^

c)

ABCD^*+

d)

ABC+D*^

13.

What will be the postfix expression for the following infix expression :

Aarush + Saisha * Viaan ^ D

a)

AarushSaishaViaanD+*^

b)

AarushSaishaViaanD*+^

c)

AarushSaishaViaanD^*+

d)

AarushSaishaD+Viaan*^

14.

What do you think is the magical term for a series of values dancing around in memory?

a)

an array

b)

a tree

c)

a matrix

d)

a struct

15.

Which index do Neha, Naira, and Aanya always start arrays at?

a)

index 0

b)

index 1

c)

index 2

d)

the null character

16.

Hey there! Can you tell me what we call those cool data structures that work like a line at a theme park? You know, the ones where the first person in line gets to go first? Are they called...

a)

vectors

b)

strings

c)

queues

d)

stacks

17.

Which of the following is not an example of a linear data structure?

a)

Prisha

b)

Siya

c)

Kiara

d)

stack

18.

Imagine Eshaan and Tara are playing a game with a special type of queue. In this game, the queue is like a ring where the front and rear pointers can wrap around the end of the start of the array. What type of queue is this?

a)

Linear Queue

b)

Circular Queue

c)

Linear Queue

d)

None

19.

Hey there! Can you help me out with this fun question? 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

20.

Avani, Anika, and Ishika are playing a game of CPU trivia! 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

21.

Pushing an element into stack already having five elements and stack size of 5, then stack becomes

a)

Overflow

b)

Underflow

c)

Crash

d)

None

22.

Act of adding values into a stack is called

(a)  

23.

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

a)

Traversing

b)

Searching

c)

Retrieval

d)

Updating

24.

Data Structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.

a)

True

b)

False

25.

Which of the following function inserts elements into a Stack? Select all that apply.

a)

add()

b)

insert()

c)

push()

d)

none

26.

Which of the following function inserts elements into a Stack? Select all that apply.

a)

add()

b)

insert()

c)

push()

d)

none

27.

Which of the following function inserts elements into a Stack? Select all that apply.

a)

add()

b)

insert()

c)

push()

d)

none

28.

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

a)

variables

b)

algorithms

c)

programs

d)

data types

29.

Evaluate the following expression if the value of x=2, y=3 and z=1.

v = x + ––z + y++ +y

a)

7

b)

8

c)

9

d)

6

30.

Give the output of the following expression:

a += a++ + ++a + – –a + a– –; when a = 7

a)

31

b)

39

c)

34

d)

37

31.

Hey there! Which of the following is NOT a cool move in the world of STACKS?

a)

push

b)

pop

c)

find

d)

peek

32.

Which superhero power is used by Kabir to save all information about the calling routine in virtually every programming language that implements?

a)

Array

b)

Recursion

c)

Method

d)

Function

33.

Hey there! Can you tell me which notation is used for the following format?

Operand Operator Operand

a)

Postfix

b)

Prefix

c)

Infix

d)

None

34.

Hey there! Can you tell me which stack operation lets you peek at the value on the top?

a)

Find

b)

Search

c)

Peek

d)

None

35.

1.       Hey there! Can you tell me which statement is correct about abstract data types?

(i)  It reveals a type

(ii) It reveals a set of operations.

a)

True,False

b)

False,True

c)

False,False

d)

True,True

36.

1.       Which of the following is true about the characteristics of abstract data types?

(i)  It exports a type

(ii) It exports a set of operations.

a)

True,False

b)

False,True

c)

False,False

d)

True,True

37.

Hey there! Aarush is playing with a Stack. What do you call inserting an element to the Stack when it's not full? And what about deleting an element from the Stack when it's not empty?

a)

Insert, Delete

b)

Push, Pop

c)

Pop, Push

d)

Add, Remove

38.

Hey there! Can you guess which pile allows you to add items at one end and remove them from the other end?

a)

Stack

b)

Array

c)

List

d)

Queue

39.

4. Hey there! Which of the following cannot store non-homogeneous elements?

a)

Pointers

b)

Structure

c)

Array

d)

List

40.

Hey there! Anika, Nikita, and Neha are having a friendly debate. Can you help them out by answering this question?

Which of the following is a Non-Linear Data Structure?

a)

Stack

b)

Queue

c)

Trees

d)

Arrays

41.

Hey there! Can you help Vanya, Aisha, and Ananya solve this exciting puzzle? Which data structure allows deletion at both ends of the list but insertion only at one end?

a)

Output restricted enqueue

b)

Input restricted dequeue

c)

Stack

d)

Priority Queue

42.

Hey there! Can you guess which of the following is a Linear data structure?

a)

Trees

b)

Graphs

c)

Stack

d)

AVL trees

43.

Hey there! Can you help Riyaan solve this interesting problem? Convert the infix expression to postfix expression: (a+(b*c)/(d-e)) as (a)  

44.

14. Dhruv and Aashi are playing a game where they have to guess the initial values of front and rear pointer in a queue. What are the initial values of front and rear pointer?

a)

0 and 1

b)

0 and -1

c)

-1 and 0

d)

1 and 0

45.

15. Aanya is playing a game with circular queues and she needs to update the value of r. What should be the new value of r?

a)

r=r+1

b)

r=(r+1)% queu_size

c)

r=(r-1)% queu_size

d)

r=(r+1)%(que_size - 1)

46.

15. Hey there! In a circular queue, what's the cool formula for updating the value of r?

a)

r=r+1

b)

r=(r+1)% queu_size

c)

r=(r-1)% queu_size

d)

r=(r+1)%(que_size - 1)

47.

16. Hey there! Which of the following is not a cool move for a queue?

a)

Adding a new friend

b)

Removing a friend

c)

Going on a journey

d)

Getting back a lost item

48.

Hey there! Can you help Asher, Dhruv, and Kiara by picking out the cool applications of stack?

a)

Function calls

b)

Arthimetric expressions

c)

Towers of Hanoi

d)

All the above

49.

Hey there! Can you identify the type of linked list in the image below?

a)

Singly Linked list

b)

Doubly Linked list

c)

Circular Singly Linked list

d)

Circular Doubly Linked list

50.

Hey there! Can you identify the type of linked list shown in the image?

a)

Singly Linked list

b)

Doubly Linked list

c)

Circular Singly Linked list

d)

Circular Doubly Linked list

51.

22.A data structure where new elements can be added or removed from either ends but not in the middle is __________

a)

Stack

b)

Queue

c)

List

d)

Dequeue

52.

23. When does top value of stack changes?

a)

Before deletion

b)

After deletion

c)

At the time of deletion

d)

While checking underflow

53.

24. Queue is follows (a)   order

54.

25. No of pointers defined for Singly, Doubly linked list are __________

a)

1,2

b)

2,2

c)

2,3

d)

2,1

55.

Which Data structure defines representation of data elements in hierarchical or network fashion?

a)

Linear

b)

Ephemeral

c)

Nonlinear

d)

Direct Access

56.

Suppose you are designing a custom data structure to represent comples numbers in a programming languague .which of the following would you need to define explicitly as it is not a built in data type in most programming languages?

a)

Int

b)

Float

c)

Class

d)

Char

57.

Given a scenario where you need to represent relationship between entities such as nodes in a social network or cities connected by roads ,which data structure would be most appropriate?

a)

Tree

b)

Graph

c)

Both A & B

d)

None of the above

58.

ADT stands for

a)

Absolute Data Type

b)

Abstract Data Structure Tye

c)

Abstract Data Tree

d)

Abstract Data Type

59.

Towers of Hanoi is an example of

a)

Recursion

b)

Sequence

c)

Conditional

d)

Data Structure

60.

Joseph Problem is an example of

a)

Stack

b)

Queues

c)

Circular Queues

d)

Linked List

61.

A step by step procedure which defines a set of instructions to be executed to complete a task is called as

a)

Data Structure

b)

Algorithm

c)

Pseudocode

d)

Flowchart