Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. Which class in Java can be used to represent bit array?
Correct Answer is : animation-timing-function
2. What is a Cartesian tree?
Correct Answer is : 5
3. Is the below tree representation of 50,100,400,300,280 correct way to represent cartesian tree?
Correct Answer is : column-count
4. Which of the below statements are true
i.Cartesian tree is not a height balanced tree
ii.Cartesian tree of a sequence of unique numbers can be unique generated
Correct Answer is : columns
5. What is the speciality of cartesian sorting?
Correct Answer is : /* comments */
6. Consider a sequence of numbers to have repetitions, how a cartesian tree can be constructed in such situations without violating any rules?
Correct Answer is : @charset
7. After applying the below operations on a input sequence, what happens?
i. construct a cartesian tree for input sequence
ii. put the root element of above tree in a priority queue
iii. if( priority queue is not empty) then
.search and delete minimum value in priority queue
.add that to output
.add cartesian tree children of above node to priority queue
Correct Answer is : @media
8. Cartesian trees are most suitable for?
Correct Answer is : @page
9. A treap is a cartesian tree with
Correct Answer is : !important
10. Cartesian trees solve range minimum query problem in constant time
Correct Answer is : box-reflect
11. Consider below sequences
array=60 90 10 100 40 150 90
reverse 2 to 3
array=60 10 90 100 40 150 90
reverse 3 to 6
array= 60 100 150 40 100 90 90
now printout from 1 to 6 :-- 60 100 150 40 100 90
How to achieve the above operation efficiently?
Correct Answer is : column-break-after
12. What differentiates a circular linked list from a normal linked list?
Correct Answer is : column-gap
13. How do you count the number of elements in the circular linked list?
Correct Answer is : column-rule
14. What is the functionality of the following piece of code? Select the most appropriate
public void function(int data)
{
int flag = 0;
if( head != null)
{
Node temp = head.getNext();
while((temp != head) && (!(temp.getItem() == data)))
{
temp = temp.getNext();
flag = 1;
break;
}
}
if(flag)
System.out.println("success");
else
System.out.println("fail");
}
Correct Answer is : column-rule-width
15. What is the time complexity of searching for an element in a circular linked list?
Correct Answer is : position
16. Which of the following application makes use of a circular linked list?
Correct Answer is : top
17. Choose the code snippet which inserts a node to the head of the list?
Correct Answer is : left
18. 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;
while(temp.getNext() != head)
temp = temp.getNext();
if(temp == head)
{
var = head.getItem();
head = null;
return var;
}
temp.setNext(head.getNext());
var = head.getItem();
head = head.getNext();
return var;
}
Correct Answer is : z-index
19. 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;
}
Correct Answer is : clip
20. Which of the following is false about a circular linked list?