ExamVeda
Login
Home
81
Consider the following operation performed on a stack of size 5.
Push(1);
Pop();
Push(2);
Push(3);
Pop();
Push(4);
Pop();
Pop();
Push(5);
After the completion of all operation, the number of elements present in stack is?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
82
The prefix form of an infix expression (p + q) - (r * t) is?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
83
What is the functionality of the following code?
public void function(Node node)
{
	if(size == 0)
		head = node;
	else
	{
		Node temp,cur;
		for(cur = head; (temp = cur.getNext())!=null; cur = temp);
		cur.setNext(node);
	}
	size++;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
84
In Linked List implementation, a node carries information regarding . . . . . . . .
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
85
What are the disadvantages of arrays?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
86
What is the term for inserting into a full queue known as?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
87
In linked list implementation of a queue, front and rear pointers are tracked. Which of these pointers will change during an insertion into a NONEMPTY queue?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
88
In linked list implementation of a queue, where does a new element be inserted?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
89
The following function reverse() is supposed to reverse a singly linked list. There is one line missing at the end of the function.
/* Link list node */
struct node
{
    int data;
    struct node* next;
};
 
/* head_ref is a double pointer which points to head (or start) pointer 
  of linked list */
static void reverse(struct node** head_ref)
{
    struct node* prev   = NULL;
    struct node* current = *head_ref;
    struct node* next;
    while (current != NULL)
    {
        next  = current->next;  
        current->next = prev;   
        prev = current;
        current = next;
    }
    /*ADD A STATEMENT HERE*/
}

What should be added in place of "/*ADD A STATEMENT HERE*/", so that the function correctly reverses a linked list.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
90
What is the value of the postfix expression 6 3 2 4 + - *?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board