31. Which of the following application makes use of a circular linked list?
32. To implement a stack using queue(with only enqueue and dequeue operations), how many queues will you need?
33. Which data structure is needed to convert infix notation to postfix notation?
34. What is the functionality of the following code? Choose the most appropriate answer.
public int function()
{
if(head == null)
return Integer.MIN_VALUE;
int var;
Node temp = head;
Node cur;
while(temp.getNext() != head)
{
cur = temp;
temp = temp.getNext();
}
if(temp == head)
{
var = head.getItem();
head = null;
return var;
}
var = temp.getItem();
cur.setNext(head);
return var;
}
public int function()
{
if(head == null)
return Integer.MIN_VALUE;
int var;
Node temp = head;
Node cur;
while(temp.getNext() != head)
{
cur = temp;
temp = temp.getNext();
}
if(temp == head)
{
var = head.getItem();
head = null;
return var;
}
var = temp.getItem();
cur.setNext(head);
return var;
}35. 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);
}
void fun1(struct node* head)
{
if(head == NULL)
return;
fun1(head->next);
printf("%d ", head->data);
}36. A normal queue, if implemented using an array of size MAX_SIZE, gets full when?
37. Process of inserting an element in stack is called . . . . . . . .
38. Convert the following Infix expression to Postfix form using a stack.
x + y * z + (p * q + r) * s, Follow usual precedence rule and assume that the expression is legal.
x + y * z + (p * q + r) * s, Follow usual precedence rule and assume that the expression is legal.
39. After performing these set of operations, what does the final list look contain?
InsertFront(10);
InsertFront(20);
InsertRear(30);
DeleteFront();
InsertRear(40);
InsertRear(10);
DeleteRear();
InsertRear(15);
display();
InsertFront(10); InsertFront(20); InsertRear(30); DeleteFront(); InsertRear(40); InsertRear(10); DeleteRear(); InsertRear(15); display();
40. Circular Queue is also known as . . . . . . . .
Read More Section(Introduction to Data Structures)
Each Section contains maximum 100 MCQs question on Introduction to Data Structures. To get more questions visit other sections.
