SRM RMP-MCA -20.01.2024-FN

SRM RMP-MCA -20.01.2024-FN

Professional Development

15 Qs

quiz-placeholder

Similar activities

SASI -BATCH 3-DAY6-FN(25.11.23)

SASI -BATCH 3-DAY6-FN(25.11.23)

Professional Development

15 Qs

Technical English: Measuring instruments

Technical English: Measuring instruments

Professional Development

10 Qs

Body Parts and Health

Body Parts and Health

6th Grade - Professional Development

18 Qs

SOAL ANNOUNCEMENT

SOAL ANNOUNCEMENT

Professional Development

15 Qs

Minecraft Quiz

Minecraft Quiz

Professional Development

11 Qs

Belajar dasar bahasa inggris

Belajar dasar bahasa inggris

KG - Professional Development

19 Qs

US-UK Political systems

US-UK Political systems

Professional Development

11 Qs

Kids 1_4  Unit 7 Vocabulary 1: My Body

Kids 1_4 Unit 7 Vocabulary 1: My Body

Professional Development

17 Qs

SRM RMP-MCA -20.01.2024-FN

SRM RMP-MCA -20.01.2024-FN

Assessment

Quiz

English

Professional Development

Hard

Created by

CCC info@ccc.training

Used 1+ times

FREE Resource

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); }
Prints all nodes of linked lists
Prints all nodes of linked list in reverse order
Prints alternate nodes of Linked List
Prints alternate nodes in reverse order

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; }
2 <--> 1 <--> 4 <--> 3 <--> 6 <--> 5
5 <--> 4 <--> 3 <--> 2 <--> 1 <--> 6
6 <--> 5 <--> 4 <--> 3 <--> 2 <--> 1
6 <--> 5 <--> 4 <--> 3 <--> 1 <--> 2

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); }
1 2 3 4 5 6
1 3 5 5 3 1
1 3 5 1 3 5
2 4 6 1 3 5

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; }
15
20
5
1

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; }
Returns the original linked list
Returns the linked list after reversing it
Returns a linked list containing elements at odd indices only
None of the above

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; } }
1 2 3 4 5
5 4 3 2 1
1 3 5 2 4
2 4 1 3 5

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; }
Find middle element in the linked list.
Find last element in the linked list
Find first element in the linked list
None of the above

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?