
SRM RMP-MCA -20.01.2024-FN
Authored by CCC info@ccc.training
English
Professional Development
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the following function do? void fun1(struct node* head) { if(head == NULL) return; fun1(head->next); printf("%d ", head->data); }
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the modified list after the following double linked list is passed to the function call: NULL<-1 <--> 2 <--> 3 <--> 4 <--> 5 <-->6->NULL void fun(struct node **head_ref) { struct node *temp = NULL; struct node *current = *head_ref; while (current != NULL) { temp = current->prev; current->prev = current->next; current->next = temp; current = current->prev; } if(temp != NULL ) *head_ref = temp->prev; }
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following code snippet for the list 1->2->3->4->5->6? void solve(struct node* start) { if(start == NULL) return; printf("%d ", start->data); if(start->next != NULL ) solve(start->next->next); printf("%d ", start->data); }
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will the function return if the following list is passed 1 -> 2 -> 3 -> 4 -> 5 int solve(ListNode* root) { int sum = 0; while (root != NULL) { sum += root -> val; root = root -> next; } return sum; }
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the following code snippet do? ListNode* solve(ListNode* head) { ListNode* prev = NULL; if(head == NULL) { return head; } if(head -> next == NULL) { return head; } ListNode* curr = head -> next; while(head != NULL) { head -> next = prev; prev = head; head = curr; if(curr != NULL) { curr = curr -> next; } } return prev; }
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following code snippet for 1->2->3->4->5? void solve (ListNode* head) { while(head != NULL) { cout << head -> data << " "; head = head -> next; } }
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the following code snippet do? int solve (ListNode* list) { ListNode* fast = list; ListNode* slow = list; while(fast -> next != NULL && fast -> next -> next != NULL) { fast = fast -> next -> next; slow = slow -> next; } return slow -> data; }
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Microsoft
or continue with
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?