Time Left - 15:00 mins

GATE 2023 Programming and Data Structures Quiz 3

Attempt now to get your rank among 35 students!

Question 1

Consider a 2D array A[-5….5][10……15], base address is 100 and word length 2B find address of the element A[2][13] using Row major order:-

Question 2

What is the output of the following program in a 64 bit machine?(int will take 4 byte)
int main()
{
int a[] = {2, 3, 4};
printf(“%d %d %d”, sizeof(a), sizeof(&a), sizeof(a[0]));
}

Question 3

Consider the following linked list.



Following operations are performed on this singly linked list:

i) struct node *p;

ii) p = s --> next -->next-->next-->next;

iii) s --> next -->next-->next = p -->next-->next ;

iv) p = s --> next -->next-->next-->next;

v) p --> next = s --> next -->next;

vi) Pf(s --> next -->next-->next --> next -->next-->next --> next -->next-->next--> next -->next-->next-->data)

What will the last statement print?

Question 4

What does the following code do (head is pointing to first node)?
void fun(struct node* head)
{
if(head == NULL)
return;
printf("%d ", head->data);
fun(head->next)
printf("%d ", head->data);
}

Question 5

Consider the following Linked List and perform the following operations:

Let temp be the pointer to the first node

p = temp -> next

temp = p->next ->next

p -> next = temp -> next

What will be the result of (temp ->data) (p->next->data).

Question 6

Consider the following Circular Queue implemented with Circular Linked List:

What is the sum of numbers in the list pointed by front and rear after performing one insertion(24), two deletions and one insertion(12) in the same order and the numbers inserted are given in the brackets next to them?

  • 35 attempts
  • 0 upvotes
  • 0 comments
Apr 19GATE & PSU CS