Time Left - 15:00 mins

GATE 2024 Programming & Data Structures Rank Booster Quiz 27

Attempt now to get your rank among 30 students!

Question 1

Consider a linked list which has 10 nodes and the nodes have value 1,2,3……10 in this order from head to last. Now this linked list is passed as parameter to the below given code :
 
Now suppose the value of n taken in above code is 4 , then what will be the value printed by above code _____________.

Question 2

Consider a linked list L which has 'n' nodes in it. Now consider an algorithm on the linked list which identifies whether a cycle exists or not in the linked list. If cycle is present , then it also finds the initial node of the cycle. What is the time complexity of the best algorithm for this problem ?

Question 3

Consider two sorted arrays A and B has distinct elements, but there may be many elements common in both A and B. What is the best case time complexity intersection of two array A and B?

Question 4

Consider the following statements:

S1 : Linked allocation scheme efficiently implement variable size file.

S2 : Contiguous allocation scheme efficiently implement fixed size file.

S3 : Search time for file in linked allocation is more than in contiguous allocation.

Which of the following is correct?

Question 5

Arrange the following Data-structures in the non-decreasing order of worst case time complexities on the operation Search :
Binary Search Trees, Linked List, Array, Hash Table

Question 6

Consider the below given code :
void XYZ(int a[R][C])
  {
      for (int j = 0; j < C; j++)
    {
        for (int i = 0; i < R/2; i++)
         swap(a[i][j], a[R- i - 1][j]);
    }
 }
A 2D array is passed as parameter to the above function XYZ. The operation done by the function XYZ on the array is :

Question 7

What is the output of following function for start pointing to first node of following linked list?

  • 30 attempts
  • 0 upvotes
  • 0 comments
Dec 12GATE & PSU CS