Загрузка...

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

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 https://www.youtube.com/monalisacs
----------------------------------------------------------
Join Telegram GATE CSE study group: https://t.me/MonalisaCSE
----------------------------------------------------------------
Algorithm Lectures :https://www.youtube.com/playlist?list=PL767-rEuXhcNz3RzupBowAjH2VIxCiY4z
Algorithm GATE PYQ: https://www.youtube.com/playlist?list=PL767-rEuXhcPvbsxbBWbDSlRZ4e6kAVve
----------------------------------------------------------------
Compiler Design Lectures :https://www.youtube.com/watch?v=THpeYyp0gwY&list=PL767-rEuXhcOgCrFXRxyvfO_4INJET0f0&index=1
Compiler Design PYQ :https://www.youtube.com/watch?v=THpeYyp0gwY&list=PL767-rEuXhcOVm9ABkyap0uSyjFz6c5cS&index=1
----------------------------------------------------------------------
Theory Of Computation Lectures https://www.youtube.com/watch?v=vDJjYGui3Ho&list=PL767-rEuXhcPQWMuHXOCZzj5PqF9YBVZt
TOC GATE PYQ: https://www.youtube.com/watch?v=K5wIww1OnCY&list=PL767-rEuXhcN7sn9TCRxhmvDpG7RLT3UK
-------------------------------------------------------------------
Data Structure Lecture: https://www.youtube.com/watch?v=mYDsGejk3zg&list=PL767-rEuXhcMiMbX4IU_oqWshY6z8Rc7j
Data Structure PYQ: https://www.youtube.com/watch?v=mYDsGejk3zg&list=PL767-rEuXhcOWUPgW1RrIkUKAle1YBdh1
-----------------------------------------------------------------------
#gate2023 #gate_cs #gate #linkedlist #datastructures

Видео GATE CS 2022 | Q5: Consider the problem of reversing a singly linked list. To take an example, given канала Monalisa CS
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять