
Linked List

Quiz
•
Computers
•
University
•
Hard
Anisha SET
Used 1+ times
FREE Resource
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
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
[Python For All] Quiz 2 - Rewind.py

Quiz
•
University
15 questions
AS Computing: Data Structures

Quiz
•
10th Grade - University
20 questions
Hash

Quiz
•
University
15 questions
Sorting

Quiz
•
University
15 questions
Social Media Basics for Educators

Quiz
•
9th Grade - Professio...
15 questions
Python Basics

Quiz
•
University
15 questions
CODE ZENITH

Quiz
•
University
15 questions
Databases

Quiz
•
10th Grade - University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University