Time Left - 10:00 mins

Campus Recruitment Tech Quiz-3

Attempt now to get your rank among 176 students!

Question 1

Consider the Quicksort algorithm in which, while partitioning the array, we always choose the first element as pivot. By choosing pivot as the first element, the worst case of quicksort can occur, which has a time complexity of O(n2). But if we choose pivot wisely, this worst case can be avoided. So we developed an algorithm that selects the median of an array in O(n2) time and then use that median to partition the array. Find the best case time complexity of this algorithm?

Question 2

In the Worst case, in Selection Sort, the total number of moves represented in order of______?

Question 3

What is the output of above program ?

Question 4

void main( )

{   static int i = 6;

     if (– – i)

       {

          main( );

          printf(“%d”, i);

       }

}

Which is the output of above program?

Question 5

Consider the following code

#include

int main()

{

char x[6] = “world”;

int k,I;

for( k=0,I=4; k<I){

x[k++]=x[I--];
}

printf(“%s\n”,x);


}

Output of the above code is

  • 176 attempts
  • 1 upvote
  • 3 comments
Aug 18GATE & PSU CS