GATE CS 2022 | Q5: Consider the problem of reversing a singly linked list. To take an example, given

Опубликовано: 15 Март 2026
на канале: Monalisa CS
1,235
35

GATE CS 2022 | Question: 5
Consider the problem of reversing a singly linked list. To take an example, given the linked list below,
The reversed linked list should look like

Which one of the following statements is TRUE about the time complexity of algorithms that solve the above problem in O(1) space?
A. The best algorithm for the problem takes 𝜃(n) time in the worst case.
B. The best algorithm for the problem takes  𝜃(n log n ) time in the worst case.
C. The best algorithm for the problem takes 𝜃(n2 ) time in the worst case.
D. It is not possible to reverse a singly linked list in O(1) space.


Ans :A
----------------------------------------------------
Subscribe my channel for more updates    / monalisacs  
----------------------------------------------------------
Join Telegram GATE CSE study group: https://t.me/MonalisaCSE
----------------------------------------------------------------
Algorithm Lectures :   • Algorithm Lectures for GATE CSE by Monalis...  
Algorithm GATE PYQ:    • Algorithm GATE CS & DA PYQ(2010-2025) solv...  
----------------------------------------------------------------
Compiler Design Lectures :   • Ch 1.1:Language Processing System |CD Lect...  
Compiler Design PYQ :   • Ch 1.1:Language Processing System |CD Lect...  
----------------------------------------------------------------------
Theory Of Computation Lectures    • Video  
TOC GATE PYQ:    • GATE CS 2010,Q39:Let L={w ∈ (0 + 1)* | w h...  
-------------------------------------------------------------------
Data Structure Lecture:    • Data Structure Syllabus for GATE  
Data Structure PYQ:    • Data Structure Syllabus for GATE  
-----------------------------------------------------------------------
#gate2023 #gate_cs #gate #linkedlist #datastructures