WorksheetsDAta Structure-unit 1&2
Total questions: 61
Worksheet time: 24mins
Myra is on a quest to find the correct term for the operation of processing each element in the list. What is it called?
Sorting
Merging
Traversing
Searching
Which of the following is not a basic building block of programming?
integer
Arrays
character
Lists
String
Which data structure uses the Last In, First Out (LIFO) mechanism?
Arrays
Stacks
Queues
Linked List
Which data structure uses the LIFO mechanism?
Arrays
Stacks
Queues
Linked List
Avni, Neha, and Advait are playing a game where the element inserted first will be removed first in the (a)
Who will be the first to be kicked out of the game of musical chairs?
(a)
When Kabir attempts to remove an element from the empty stack, what is the situation called?
Underflow
Garbage collection
Overflow
None of the above
Hey there! Can you tell me which of the following expressions is written in infix notation?
ABC+*
+A*BC
A+B*C
None of the above
#define SIZE 11
void main()
{
int stack[SIZE];
int top=-1;
}
What is the magic number that keeps the stack happy and prevents overflow?
8
9
11
10
If the elements '1', '2', '3' and '4' are inserted in a queue, what would be the order for the removal?
1324
4321
3241
None of the above
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. Enqueue
b. Dequeue
c. Return the front element
d. add an element to front
e. add an element to rear
Hey there! Can you help Ishaan figure out the postfix expression for this cool infix expression?
A + B * C ^ D
ABCD+*^
ABCD*+^
ABCD^*+
ABC+D*^
What will be the postfix expression for the following infix expression :
Aarush + Saisha * Viaan ^ D
AarushSaishaViaanD+*^
AarushSaishaViaanD*+^
AarushSaishaViaanD^*+
AarushSaishaD+Viaan*^
What do you think is the magical term for a series of values dancing around in memory?
an array
a tree
a matrix
a struct
Which index do Neha, Naira, and Aanya always start arrays at?
index 0
index 1
index 2
the null character
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...
vectors
strings
queues
stacks
Which of the following is not an example of a linear data structure?
Prisha
Siya
Kiara
stack
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?
Linear Queue
Circular Queue
Linear Queue
None
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?
Stack
Queue
List
Tree
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?
Stack
Queue
List
Tree
Pushing an element into stack already having five elements and stack size of 5, then stack becomes
Overflow
Underflow
Crash
None
Act of adding values into a stack is called
(a)
Data in the data structures are processed by operations like insertion, deletion, sorting, merging and
Traversing
Searching
Retrieval
Updating
Data Structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.
True
False
Which of the following function inserts elements into a Stack? Select all that apply.
add()
insert()
push()
none
Which of the following function inserts elements into a Stack? Select all that apply.
add()
insert()
push()
none
Which of the following function inserts elements into a Stack? Select all that apply.
add()
insert()
push()
none
Data that a variable can hold in a programming language, all programming language has a set of it.
variables
algorithms
programs
data types
Evaluate the following expression if the value of x=2, y=3 and z=1.
v = x + ––z + y++ +y
7
8
9
6
Give the output of the following expression:
a += a++ + ++a + – –a + a– –; when a = 7
31
39
34
37
Hey there! Which of the following is NOT a cool move in the world of STACKS?
push
pop
find
peek
Which superhero power is used by Kabir to save all information about the calling routine in virtually every programming language that implements?
Array
Recursion
Method
Function
Hey there! Can you tell me which notation is used for the following format?
Operand Operator Operand
Postfix
Prefix
Infix
None
Hey there! Can you tell me which stack operation lets you peek at the value on the top?
Find
Search
Peek
None
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.
True,False
False,True
False,False
True,True
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.
True,False
False,True
False,False
True,True
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?
Insert, Delete
Push, Pop
Pop, Push
Add, Remove
Hey there! Can you guess which pile allows you to add items at one end and remove them from the other end?
Stack
Array
List
Queue
4. Hey there! Which of the following cannot store non-homogeneous elements?
Pointers
Structure
Array
List
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?
Stack
Queue
Trees
Arrays
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?
Output restricted enqueue
Input restricted dequeue
Stack
Priority Queue
Hey there! Can you guess which of the following is a Linear data structure?
Trees
Graphs
Stack
AVL trees
Hey there! Can you help Riyaan solve this interesting problem? Convert the infix expression to postfix expression: (a+(b*c)/(d-e)) as (a)
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?
0 and 1
0 and -1
-1 and 0
1 and 0
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?
r=r+1
r=(r+1)% queu_size
r=(r-1)% queu_size
r=(r+1)%(que_size - 1)
15. Hey there! In a circular queue, what's the cool formula for updating the value of r?
r=r+1
r=(r+1)% queu_size
r=(r-1)% queu_size
r=(r+1)%(que_size - 1)
16. Hey there! Which of the following is not a cool move for a queue?
Adding a new friend
Removing a friend
Going on a journey
Getting back a lost item
Hey there! Can you help Asher, Dhruv, and Kiara by picking out the cool applications of stack?
Function calls
Arthimetric expressions
Towers of Hanoi
All the above
Hey there! Can you identify the type of linked list in the image below?
Singly Linked list
Doubly Linked list
Circular Singly Linked list
Circular Doubly Linked list
Hey there! Can you identify the type of linked list shown in the image?
Singly Linked list
Doubly Linked list
Circular Singly Linked list
Circular Doubly Linked list
22.A data structure where new elements can be added or removed from either ends but not in the middle is __________
Stack
Queue
List
Dequeue
23. When does top value of stack changes?
Before deletion
After deletion
At the time of deletion
While checking underflow
24. Queue is follows (a) order
25. No of pointers defined for Singly, Doubly linked list are __________
1,2
2,2
2,3
2,1
Which Data structure defines representation of data elements in hierarchical or network fashion?
Linear
Ephemeral
Nonlinear
Direct Access
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?
Int
Float
Class
Char
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?
Tree
Graph
Both A & B
None of the above
ADT stands for
Absolute Data Type
Abstract Data Structure Tye
Abstract Data Tree
Abstract Data Type
Towers of Hanoi is an example of
Recursion
Sequence
Conditional
Data Structure
Joseph Problem is an example of
Stack
Queues
Circular Queues
Linked List
A step by step procedure which defines a set of instructions to be executed to complete a task is called as
Data Structure
Algorithm
Pseudocode
Flowchart
