GATE 2023 Programming and Data Structures Quiz 3
Attempt now to get your rank among 35 students!
Question 1
Question 2
int main()
{
int a[] = {2, 3, 4};
printf(“%d %d %d”, sizeof(a), sizeof(&a), sizeof(a[0]));
}
Question 3
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
void fun(struct node* head)
{
if(head == NULL)
return;
printf("%d ", head->data);
fun(head->next)
printf("%d ", head->data);
}
Question 5
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
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