91. What is the functionality of the following piece of code?
public void function(Object item)
{
Node temp=new Node(item,trail);
if(isEmpty())
{
head.setNext(temp);
temp.setNext(trail);
}
else
{
Node cur=head.getNext();
while(cur.getNext()!=trail)
{
cur=cur.getNext();
}
cur.setNext(temp);
}
size++;
}
public void function(Object item)
{
Node temp=new Node(item,trail);
if(isEmpty())
{
head.setNext(temp);
temp.setNext(trail);
}
else
{
Node cur=head.getNext();
while(cur.getNext()!=trail)
{
cur=cur.getNext();
}
cur.setNext(temp);
}
size++;
}92. What is the time complexity to insert a node based on position in a priority queue?
93. In general, the index of the first element in an array is . . . . . . . .
94. The postfix form of A*B+C/D is?
95. Consider the following doubly linked list: head-1-2-3-4-5-tail. What will be the list after performing the given sequence of operations?
Node temp = new Node(6,head,head.getNext());
Node temp1 = new Node(0,tail.getPrev(),tail);
head.setNext(temp);
temp.getNext().setPrev(temp);
tail.setPrev(temp1);
temp1.getPrev().setNext(temp1);
Node temp = new Node(6,head,head.getNext());
Node temp1 = new Node(0,tail.getPrev(),tail);
head.setNext(temp);
temp.getNext().setPrev(temp);
tail.setPrev(temp1);
temp1.getPrev().setNext(temp1);96. Which of the following is not the application of stack?
97. Which of the following is true about linked list implementation of queue?
98. What is the time complexity of pop() operation when the stack is implemented using an array?
99. What is the time complexity of deleting from the rear end of the dequeue implemented with a singly linked list?
100. The data structure required for Breadth First Traversal on a graph is?
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.
