
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
15 questions
ARRAYLIST - JAVA

Quiz
•
University
20 questions
Data Structures and Algorithm

Quiz
•
University
20 questions
Data Structures Quiz

Quiz
•
University
15 questions
Data Structure

Quiz
•
University
15 questions
DS MODULE 3 LINKED LIST

Quiz
•
University
11 questions
Trees

Quiz
•
University
16 questions
susulan dan ramedial Uji Pemahaman Komputasional

Quiz
•
9th Grade - University
15 questions
NSCC-CODE TO COIN

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

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

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University