GATE Assistant

Past questions › Computer Science and Information Technology › GATE 2023

GATE 2023 · CS · MCQ · 1 mark · Programming and Data Structures › Linked Lists

GATE 2023 Computer Science and Information Technology question: Let SLLdel be a function that deletes a node in a singly-linked list given a pointer to…

Let SLLdel be a function that deletes a node in a singly-linked list given a pointer to the node and a pointer to the head of the list. Similarly, let DLLdel be another function that deletes a node in a doubly-linked list given a pointer to the node and a pointer to the head of the list.
Let denote the number of nodes in each of the linked lists. Which one of the following choices is TRUE about the worst-case time complexity of SLLdel and DLLdel?

  1. (A)

    SLLdel is and DLLdel is

  2. (B)

    Both SLLdel and DLLdel are

  3. (C)

    Both SLLdel and DLLdel are

  4. (D)

    SLLdel is and DLLdel is

Show answer

Official answer: D

Practise this question with exam-style marking

Discussion

No discussion yet.

Join the discussion