
Linked List
Authored by Anisha SET
Computers
University
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
30 sec • 1 pt
Consider a C Code fragment given below:
Assuming that m and n point to valid NULL-terminated linked lists, invocation of join will-
append list m to the end of list n for all inputs
either cause a null pointer dereference or append list m to the list n
cause a null pointer dereference for all inputs
append list n to the end of list m for all inputs
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Let P be a singly linked list, Let Q be the pointer to an intermediate node x in the list.What is the worst-case time complexity of the best known algorithm to delete the node x from the list?
O(n)
O(log n)
O(1)
O(log2n)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following function do for a given Linked List with first node as head?
Prints alternate nodes of Linked List
Prints all nodes of linked list in reverse order
Prints alternate nodes in reverse order
Prints all nodes of linked lists
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following function reverse() is supposed to reverse a singly linked list. There is one line missing at the end of the function.
What should be added in place of "/*ADD A STATEMENT HERE*/", so that the function correctly reverses a linked list.
*head_ref = prev;
*head_ref = current;
*head_ref = next;
*head_ref = NULL;
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of following function in which start is pointing to the first node of the following linked list 1->2->3->4->5->6 ?
1 4 6 6 4 1
1 3 5 1 3 5
1 2 3 5
1 3 5 5 3 1
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following C function takes a simply-linked list as input argument. It modifies the list by moving the last element to the front of the list and returns the modified list. Some part of the code is left blank. Choose the correct alternative to replace the blank line.
q = NULL; p->next = head; head = p;
q->next = NULL; head = p; p->next = head;
head = p; p->next = q; q->next = NULL;
q->next = NULL; p->next = head; head = p;
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the function f defined below:
For a given linked list p, the function f returns 1 if and only if
not all elements in the list have the same data value.
the elements in the list are sorted in non-decreasing order of data value
the elements in the list are sorted in non-increasing order of data value
None of them
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 Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
16 questions
W6_BIS
Quiz
•
University
20 questions
DreamWeaver CS6
Quiz
•
University
10 questions
CHAPTER 1: COMPUTER SECURITY REVIEW
Quiz
•
University
13 questions
Chap 1: What is a program made of?
Quiz
•
University
10 questions
Introduction to AI - Healthcare & Business
Quiz
•
University - Professi...
15 questions
Komponen Jaringan & Pengkabelan
Quiz
•
University
19 questions
DSA Quest 1.0
Quiz
•
University
10 questions
Lourdes Amaranta Ayala Gracia
Quiz
•
8th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade