Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. Which of the following is false about a doubly linked list?
Correct Answer is : ‘#’
2. Given the Node class implementation, select one of the following that correctly inserts a node at the tail of the list.
public class Node
{
protected int data;
protected Node prev;
protected Node next;
public Node(int data)
{
this.data = data;
prev = null;
next = null;
}
public Node(int data, Node prev, Node next)
{
this.data = data;
this.prev = prev;
this.next = next;
}
public int getData()
{
return data;
}
public void setData(int data)
{
this.data = data;
}
public Node getPrev()
{
return prev;
}
public void setPrev(Node prev)
{
this.prev = prev;
}
public Node getNext
{
return next;
}
public void setNext(Node next)
{
this.next = next;
}
}
public class DLL
{
protected Node head;
protected Node tail;
int length;
public DLL()
{
head = new Node(Integer.MIN_VALUE,null,null);
tail = new Node(Integer.MIN_VALUE,null,null);
head.setNext(tail);
length = 0;
}
}
Correct Answer is : em
3. What is a memory efficient double linked list?
Correct Answer is : vw
4. Which of the following piece of code removes the node from a given position?
Correct Answer is : RGB Color
5. How do you calculate the pointer difference in a memory efficient double linked list?
Correct Answer is : check
6. What is the time complexity of inserting a node in a doubly linked list?
Correct Answer is :
7. How do you insert a node at the beginning of the list?
Correct Answer is : file
8. 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);
Correct Answer is :
9. What is the functionality of the following piece of code?
public int function()
{
Node temp = tail.getPrev();
tail.setPrev(temp.getPrev());
temp.getPrev().setNext(tail);
size--;
return temp.getItem();
}
Correct Answer is : href
10. 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());
head.setNext(temp);
temp.getNext().setPrev(temp);
Node temp1 = tail.getPrev();
tail.setPrev(temp1.getPrev());
temp1.getPrev().setNext(tail);
Correct Answer is : red
11. What is a dynamic array?
Correct Answer is : both single quotes and double quotes
12. What is meant by physical size in a dynamic array?
Correct Answer is : Counters
13. The number of items used by the dynamic array contents is its __________
Correct Answer is : 6-Hex Color
14. How will you implement dynamic arrays in Java?
Correct Answer is : HSLa Color
15. Which of the following is the correct syntax to declare an ArrayList in Java?
Correct Answer is : RGB Color
16. In what type of dynamic array do you divide the array into two parts?
Correct Answer is : unicode-bidi
17. What are the advantages of dynamic arrays?
Correct Answer is : visibility
18. What is the time complexity for inserting/deleting at the beginning of the array?
Correct Answer is : white-space
19. What is the other name for a postfix expression?
Correct Answer is : widows
20. Which of the following is an example for a postfix expression?