NEW
Font size
WorksheetsFSA_DSA_QUIZ_Jan'24
Total questions: 53
Worksheet time: 2hrs 46mins
People have used the word ________ to mean computer information that is transmitted or stored.
Beta
Data
Database
None of above
_____________ specifies how we enter data into our programs and what type of data we enter.
data type
data
datum
all of above
Array is ___________ data type.
user defined
primary
derived
all of above
In ____________ data structure, the data items are arranged in a linear sequence.
linear
non linear
both a and b
all of above
In ___________ data structures all elements may or may not be of same type.
linear
non linear
homogeneous
non- homogeneous
Stack uses __________ data structure as the element that was inserted last is the first one to be taken out.
LIPO
FIFO
LIFO
FIPO
Full form of LIFO is ____________
Last Inside First Outside
Last Innner First Outer
Last In First Out
Last Impact First Out
Every stack has a variable _________ associated with it.
TOP
BOT
POT
none of the above
_________ operation removes the element from the top of the stack.
push
pop
update
none of the above
_________ operation changes the value of element given by user of the stack.
push
pop
peep
update
A function calls itself is called ___________.
queue
recursion
function
none of above
Complex data structures built on top of linked lists, that use First-In First-Out behaviour, are called ___
vectors
strings
queues
stacks
In a stack, if a user tries to remove an element from empty stack it is called _________
Underflow
Empty collection
Overflow
Garbage Collection
User perform following operations on stack of size 5 then -
push(1);
pop();
push(2);
push(3);
pop();
push(2);
pop();
pop();
push(4);
pop();
pop();
push(5);
Overflow Occurs
Stack Operations will be performed Smoothly
Underflow Occurs
None of these
What is the value of the postfix expression 6 3 2 4 + – *
1
40
74
-18
The following postfix expression with single digit operands is evaluated using a stack:
8 2 3 ^ / 2 3 * + 5 1 * -
6,1
5,7
3,2
1,5
To evaluate an expression without any embedded function calls:
One stack is enough
Two stacks are needed
As many stacks as the height of the expression tree are needed
A Turing machine is needed in the general case
What will be the postfix form of the above expression -
(A+B)∗(C∗D-E)∗F/G
None of these
A B + C D ∗ E − F G ∗ / ∗
A B + C D E ∗ − F G / ∗ ∗
A B + C D ∗ E − F G / ∗ ∗
Which one of the following is an application of Stack Data Structure?
Managing function calls
The stock span problem
Arithmetic expression evaluation
All of the above
The following postfix expression with single digit operands is evaluated using a stack:
Note that ^ is the exponentiation operator. The top two elements of the stack after the first * is evaluated are:
6,1
5,7
3,2
1,5
If the sequence of operations - push (1), push (2), pop, push (1), push (2), pop, pop, pop, push (2), pop are performed on a stack, the sequence of popped out values
2,2,1,1,2
2,2,1,2,2
2,1,2,2,1
2,1,2,2,2
Which of the following is not an inherent application of stack?
Implementation of recursion
Evaluation of a postfix expression
Job scheduling
Reverse a string
What advantage does a linked list have over an array?
Size of the list doesn't need to be mentioned at the beginning of the program
You can add or remove elements from the middle of the list.
The linked list doesn't have a size limit
All of these are true.
Nodes in a linked list contain two things
Direction and a pointer
Data and a pointer
A Pointer and a reference
A pointer and a node
The situation when in a linked list Head==NULL
is
Full
Empty
Half full
saturated
In the above image what will be printed when Head->next->data?
83
9
27
Error
Complete the code in the red column
string info; int link;
int info; NodeType link;
int info; string link;
int info; NodeType * link;
Which of the following statement is not correct?
List is a linear structure
There are 2 example of list, Array List & Linked List.
Array List is not an example of List
List contains a sequence of elements
What is value in the head -> next -> next below?
12
4600
1600
88
How to delete node B?
head->next=TempPtr; free(TemPtr);
free(TemPtr); head->next=TempPtr->next;
head->next=TempPtr->next;free(TemPtr)r;
free(head); head->next= TempPtr->next
How many times should
“temp =temp->next” be executed in the image to get the value of "Null" when the initial value of temp is temp=head
1
2
3
4
How many null pointers exists in a circular linked list?
0
1
2
3
--------------------- is used to define a linked list in C Programming
Arrays
Structures
Functions
None
Circular Linked List will be
Only Singly
Only Doubly
Singly and Doubly
None
Doubly Linked List Consists of
1-Data , 1- Address
2-Data , 1- Address
1-Data , 0- Address
1-Data , 2- Address
Which of the following is a valid way
to comment a single-line code in Python?
/* comment */
<!-- comment -->
# comment
/* comment */
Tree
data structure similar to a graph, with no loops.
an object in a graph also known as a vertex
a join of relationship between nodes - also know as an arc
the starting node in a rooted tree structure from which all other nodes branch off./
Root
data structure similar to a graph, with no loops.
an object in a graph also known as a vertex
a join of relationship between nodes - also know as an arc
the starting node in a rooted tree structure from which all other nodes branch off./
What is the value of the ROOT node in this Tree?
35
24
42
20
Binary TREE
data structure similar to a graph, with no loops.
an object in a graph also known as a vertex
a join of relationship between nodes - also know as an arc
a tree where each node can only have 2 child nodes attached to it
In preorder traversal of a binary tree the second step is ____________
traverse the right subtree
traverse the left subtree
traverse right subtree and visit the root
visit the root
How many leaf are there in the tree?
1
3
4
7
Which of these tree traversal methods is used to output the contents of a binary tree in ascending order?
Pre-Order
In-Order
Post-Order
Monastic Orders
What are the 3 depth traversals for a tree data structure?
Pre-, In- and Post-order
Pro-, In- and Past-order
Pre-, Out- and Post-order
Pre-, In- and New-order
When traversing a binary tree, which diagram is post-order?
When traversing a binary tree, which diagram is pre-order?
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?
3
4
5
6
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?
5,15,27,34,47,54,63,70,72,75,83,85,88,94,99,101
72,54,34,5,27,15,47,63,70,83,75,88,85,101,94,99
15,27,5,47,34,70,63,54,75,85,99,94,101,88,83,72
15,27,5,47,34,63,54,70,75,85,99,94,101,88,83,72
none of the above
Choose the correct statement
A data structure is a specialised format for organising and storing data
A data structure is a specialised format for organising and storing information
A data structure is a format for organising and storing only one data type
A data structure is too complicated to truly understand or use
Algorithm is a __________________ procedure.
shortcut
function
reverse
step by step
