Time Left - 05:00 mins

NIELIT Scientific / Technical Assistant-A Daily Quiz-2 (PDS)

Attempt now to get your rank among 440 students!

Question 1

What is the minimum runtime to reverse a doubly linked list?

Question 2

Consider the following algorithm for searching for a given number x in an unsorted array A[1..n] having n distinct values:
1. Choose an i uniformly at random from 1…n
2. If A[i]=x then Stop else Goto 1;
Assuming that x is present A, what is the expected number of comparisons made by the algorithm before it terminates?

Question 3

Let Q denote a queue containing sixteen numbers and S be an empty stack. Head(Q) returns the element at the head of the queue Q without removing it from Q. Similarly Top(S) returns the element at the top of S without removing it from S. Consider the algorithm given below.
while Q is not Empty do

The maximum possible number of iterations of the while loop in the algorithm is _________.

Question 4

What will be the postfix equivalent of the following infix expression:

Question 5

Consider the following code
void funto(Queue *Q1)
{
       Stack S1;
       While (! isEmpty (Q1) )
       {
                  Push(&S, deQueue (Q1) );
       }

       While (! isEmpty(&S) )
       {
                  enQueue (Q, POP (&s));
        }

}
  • 440 attempts
  • 2 upvotes
  • 5 comments
Mar 26GATE & PSU CS