Linked List

Linked List

University

15 Qs

quiz-placeholder

Similar activities

Stack & Queue

Stack & Queue

University

16 Qs

Linkedlist

Linkedlist

University

10 Qs

Quiz 1 - AK2 Section

Quiz 1 - AK2 Section

University

10 Qs

Data Structure

Data Structure

University

20 Qs

Quiz 1_DSA

Quiz 1_DSA

University

20 Qs

DATA STRUCTURES QUIZ

DATA STRUCTURES QUIZ

University

15 Qs

Uji Pemahaman Struktur Data

Uji Pemahaman Struktur Data

9th Grade - University

20 Qs

Linked List - Implementation

Linked List - Implementation

University

15 Qs

Linked List

Linked List

Assessment

Quiz

Computers

University

Hard

Created by

Anisha SET

Used 1+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

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

Media Image

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

Media Image

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

Media Image

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

Media Image

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

Media Image

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

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?