ExamVeda
Login
Home
41
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;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
42
What does 'stack overflow' refer to?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
43
What is the functionality of the following piece of code?
public void fun(int x)
{
	q1.offer(x);
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
44
In a stack, if a user tries to remove an element from an empty stack it is called . . . . . . . .
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
45
A data structure in which elements can be inserted or deleted at/from both ends but not in the middle is?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
46
What does the following function check for? (all necessary headers to be included and function is called from main)
#define MAX 10
 
typedef struct stack
{
    int top;
    int item[MAX];
}stack;
 
int function(stack *s)
{
    if(s->top == -1)
        return 1;
    else return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
47
What are the applications of dequeue?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
48
A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is known as . . . . . . . .
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
49
With what data structure can a priority queue be implemented?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
50
When does the ArrayIndexOutOfBoundsException occur?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board