Font size
WorksheetsDS QUIZ 1
Total questions: 85
Worksheet time: 51mins
The situation when in a linked list START=NULL is
underflow
overflow
housefull
saturated
Each node in a linked list has two pairs of ………….. and ……………….
Link field and information field
Link field and avail field
Avail field and information field
Address field and link field
A linear list in which each node has pointers to point to the predecessor and successors nodes is called as
Singly Linked List
Circular Linked List
Doubly Linked List
Linear Linked List
Linked lists are best suited
for relatively permanent collections of data
for the size of the structure and the data in the structure are constantly changing
for both of above situation
for none of above situation
Arrays are best suited
for relatively permanent collections of data
for the size of the structure and the data in the structure are constantly changing
for both of above situation
for none of above situation
Which of the following data structure is linear type?
List
Tree
Graph
All of the above
Which of these best describes an array?
A data structure that shows a hierarchical behavior
Container of objects of similar types
Arrays are immutable once initialized
Array is not a data structure
To create a linked list, we can allocate space and make something point to it, by
writing:
struct-name *pointer-variable;
Which of the following statement will correctly allocate the space
pointer-variable= malloc(sizeof(*struct-name));
pointer-variable = malloc(sizeof(struct struct-name));
pointer-variable = alloc(sizeof(struct struct-name));
pointer-variable = alloc(sizeof(*struct-name));
The situation when in a linked list HEAD=NULL is
Underflow
Overflow
Housefull
Saturated
What does a linked list use to store it's data?
Node
Step
Array
Module
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);
}
Prints all nodes of linked lists
Prints all nodes of linked list in reverse order
Prints alternate nodes of Linked List
Prints alternate nodes in reverse order
How many pointers are necessarily changed for the insertion in a Linked List?
1
2
3
5
Stack is also called as
Last in first out
First in last out
Last in last out
First in first out
Which of the following is not the part of ADT description?
Data
Operations
Both of the above
None of the above
Which of the following data structure is non linear type?
string
List
stack
graph
Identify the data structure which allows deletions at both ends of the list but insertion at only one end.
Input restricted dequeue
Output restricted dequeue
Priority queues
Linear queue
Which of the following data structure can’t store the non-homogeneous data elements?
Arrays
Records
pointer
stack
Which data structure allows deleting data elements front and inserting at rear?
stack
queue
deque
Array
………… is very useful in situation when data have to stored and then retrieved in reverse order
stack
queue
deque
array
Inserting an item into the stack when stack is not full is called …………. Operation and deletion of item form the stack, when stack is not empty is called ………..operation.
push, pop
pop, push
insert, pop
push, delete
. …………… is not the component of the data structure
operation
Storage Structures
Algorithm
Non of the above
Stack Full condition
TOP==-1
TOP==0
TOP==MAX
TOP==MAX-1
Stack Empty condition
TOP==-1
TOP==0
TOP==MAX
TOP==MAX-1
Linear queue full condition
REAR==MAX
REAR==MAX-1
FRONT==MAX
FRONT==MAX-1
Linear queue contains one elements, when---------
REAR==-1
REAR==FRONT
FRONT==1
REAR==1 && FRONT==-1
Circular queue is empty
REAR==FRONT
REAR==0
REAR==-1
FRONT==0
circular queue is full condition
REAR==MAX-1 && FRONT==1
REAR==0 && FRONT==MAX-1
REAR==MAX-1 && FRONT==MAX-1
REAR==MAX-1 && FRONT==0
Which of the following is an infix expression?
ab+c*
abc+*
(a+b)*(c+d)
+a+bc
What is the postfix expression for the corresponding infix expression?
a+b*c+(d*e)
abc*+de*+
abc+*de*+
a+bc*de+*
abc*+(de)*+
Which of the following points is/are true about Linked List data structure when it is compared with array
Arrays have better cache locality that can make them better in terms of performance.
It is easy to insert and delete elements in Linked List
Random access is not allowed in a typical implementation of Linked Lists
The size of array has to be pre-decided, linked lists can change their size any time.
All of the above
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);
}
Prints all nodes of linked lists
Prints all nodes of linked list in reverse order
Prints alternate nodes of Linked List
Prints alternate nodes in reverse order
Which of the following is not a disadvantage to the usage of array?
Fixed size
There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
Insertion based on position
Accessing elements at specified positions
Which of the following operations is performed more efficiently by doubly linked list than by singly linked list?
Deleting a node whose location in given
Searching of an unsorted list for a given item
Inverting a node after the node with given location
Traversing a list to process each node
In linked list each node contain minimum of two fields. One field is data field to store the data second field is?
Pointer to character
Pointer to integer
Pointer to node
Node
Linked lists are not suitable to for the implementation of?
Insertion sort
Radix sort
Polynomial manipulation
Binary search
Linked list is considered as an example of ___________ type of memory allocation.
Dynamic
Static
Compile time
None of the mentioned
Under which data structure category does the Stack fall?
Homogeneous
Built-in
Non linear
Linear
The data structure which expands and shrinks as per demand is called:
Array
Dynamic
Linked list
Non-linear
The operation to arrange all elements in required order is called:
Search
Insertion
Sorting
Merging
Identify the correct statement:
Stack is FIFO and Queue is LIFO
Stack is LIFO and Queue is FIFO
Stack and Queue are both LIFO
Stack and Queue are both FIFO
Given a prefix and a postfix notation what are the difference between them?
The postfix equation is solved starting from the right whereas the prefix notation is solved from the left
The postfix equation is solved starting from the left whereas the prefix notation is solved from the right
The postfix equation is solved starting from the left whereas the prefix notation is solved from the right
The postfix equation is solved starting from the left whereas the prefix notation is solved from the left
Consider the following pseudocode that uses a stack
declare a stack of characters
while ( there are more characters in the word to read ){
{
read a character
push the character on the stack
}
while ( the stack is not empty )
{ pop a character off the stack
write the character to the screen
}
What is output for input "computer"?
computer
computercomputer
retupmocretupmoc
retupmoc
In __________ notation, the operator is placed between the operands.
infix
prefix
postfix
none of
above
_________ is any node with an out-degree of zero.
root
internal node
parent
leaf
A node that is not a root or a leaf is known as __________ node because it is found in the middle portion of a tree.
root
leaf
internal node
tree
A node is a __________ if it has successor nodes - that is, if it has an out-degree greater than zero.
child
parent
siblings
none of above
If the tree is not empty, then the first node is called ________.
leaf
internal node
root
none of above
A node is a __________ if it has successor nodes - that is, if it has an out-degree greater than zero.
child
parent
siblings
none of above
A node with a predecessor is a ______ . It has an in-degree of one.
child
parent
siblings
none of above
Two or more nodes with the same parent are _______.
child
parent
siblings
none of above
An _________ is any node in the path from root to the node.
Ancestor
Descendent
tree
none of above
A binary tree in which every node other than leaf nodes has two children is called ________.
full binary tree
complete binary tree
half binary tree
complete half binary tree
____________data structures are those whose sizes and structures associated memory locations are fixed at compile time.
linear
homogeneous
static
dynamic
Any two nodes which are connected by an edge in a graph are called _________ nodes.
Adjacent
Proper
Node
None of above
. An edge of a graph which joins a node to itself is called ________.
node
loop
tree
none of above
Distinct edges which connect the same end points are called _________ edges.
parallel
level
both a and b
none of above
In a graph, a node which is not adjacent to any other node is called _______ node
multi
single
isolated
none of above
The no. of edges appearing in the sequence of a path is called the _______of the path.
length
width
height
none of above
The path is a __________ if it begins and ends at the same vertex.
wheel
circuit
length
none of above
Why do we need to organize data in a computer? Check all possible answers.
You will easily direct someone to access a file for you.
You will easily update back-ups or switch computers.
You will always know where to find what you need.
You will never waste time where to save anything.
How do you call this special function that is used to map a given value with a particular key for faster access of elements?
merge
sorted array
hash
bubble
State the meaning of "void" keyword:
No statement
No function
No program
No value
Which of the following operator can be used to access value at address stored in a pointer variable?
*
&
->
.
What is the output of the below code snippet?
Infinite loop
Prints “Hello” once
No output
Compile error
To create a linked list, we can allocate space and make something point to it, by
writing:
struct-name *pointer-variable;
Which of the following statement will correctly allocate the space
pointer-variable= malloc(sizeof(*struct-name));
pointer-variable = malloc(sizeof(struct struct-name));
pointer-variable = alloc(sizeof(struct struct-name));
pointer-variable = alloc(sizeof(*struct-name));
Which type of linked list comprises a node containing a pointer to predecessor as well as successor?
Singly linked list
Doubly Linked List
Circular Linked List
None of the above
Applications of Linked list
Polynomial Arithmetic
Multi lists
Radix Sort
All the above
What is the output of following function for start pointing to first node of following linked list? 1->2->3->4->5->6
void fun(struct node* start)
{
if(start == NULL)
return;
printf("%d ", start->data);
if(start->next != NULL )
fun(start->next->next);
printf("%d ", start->data);
}
1 4 6 6 4 1
1 3 5 1 3 5
1 2 3 5
1 3 5 5 3 1
Linked list is considered as an example of ___________ type of memory allocation.
Static
Dynamic
Compile time
None of the mentioned
Which of the following points is/are true about Linked List data structure when it is compared with array
Arrays have better cache locality that can make them better in terms of performance
It is easy to insert and delete elements in Linked List
Random access is not allowed in a typical implementation of Linked Lists
All of the mentioned
Which of the following operations is performed more efficiently by doubly linked list than by singly linked list?
Deleting a node whose location in given
Searching of an unsorted list for a given item
Inverting a node after the node with given location
Traversing a list to process each node
A variant of the linked list in which none of the node contains NULL pointer is?
Singly linked list
Doubly linked list
Circular linked list
None of the above
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) ABDC
how to insert a node at the end of Doubly Linked list?
while(p->next!=NULL)
p=p->next;
newnode->next=NULL;
p->next=newnode;
newnode->prev=p;
while(p->!=NULL)
p=p->next;
newnode->next=NULL;
p->next=newnode;
while(p->next!=NULL)
p=p->next;
newnode->next=NULL;
newnode->prev=p;
while(p->next!=NULL)
p=p->next;
newnode->next=NULL;
p->next=newnode;
newnode->prev=NULL;
While evaluating the postfix expression, what would be pushed into the stack?
operands
operators
operators and opening symbols
operators and operands
stack is not used for this evaluation
