SRM RMP-MCA -20.01.2024-FN

SRM RMP-MCA -20.01.2024-FN

Professional Development

15 Qs

quiz-placeholder

Similar activities

Future time

Future time

Professional Development

14 Qs

VCE FDP DAY-7 24 JAN 2024

VCE FDP DAY-7 24 JAN 2024

Professional Development

15 Qs

active listening

active listening

Professional Development

10 Qs

Formal Email Writing

Formal Email Writing

Professional Development

10 Qs

Prepositions of place

Prepositions of place

Professional Development

10 Qs

VCE-GAMMA-21.11.2023-FN

VCE-GAMMA-21.11.2023-FN

Professional Development

15 Qs

Sasi-AN-02.05.2024

Sasi-AN-02.05.2024

Professional Development

15 Qs

VCE-ALPHA-22.11.2023-FN

VCE-ALPHA-22.11.2023-FN

Professional Development

15 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?