Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
••
Sichere ProgrammierungCloudflare outage 2019: how one regex caused 27 minutes of 502s(29.09.2026 um 05:46 Uhr)
•
Sichere ProgrammierungHow boxr runs rootless: namespaces, a trampoline, and uid mapping(29.09.2026 um 05:47 Uhr)
••
Sichere ProgrammierungTech Stack for Thumbrella Cloud(29.09.2026 um 05:51 Uhr)
•
AI & KI NachrichtenStructured Outputs vs function calling in the OpenAI API(29.09.2026 um 05:53 Uhr)
•
Sichere ProgrammierungSMS OTP API Ownership: 6 Rate Limit Rules for SaaS Login Recovery(29.09.2026 um 05:55 Uhr)
•
Sichere ProgrammierungHow I Review AI-Generated HTML Before Publishing It(29.09.2026 um 05:58 Uhr)
•
Sichere ProgrammierungAI - Weights(29.09.2026 um 05:59 Uhr)
•••
Sichere ProgrammierungCloudflare outage 2019: how one regex caused 27 minutes of 502s(29.09.2026 um 05:46 Uhr)
•
Sichere ProgrammierungHow boxr runs rootless: namespaces, a trampoline, and uid mapping(29.09.2026 um 05:47 Uhr)
••
Sichere ProgrammierungTech Stack for Thumbrella Cloud(29.09.2026 um 05:51 Uhr)
•
AI & KI NachrichtenStructured Outputs vs function calling in the OpenAI API(29.09.2026 um 05:53 Uhr)
•
Sichere ProgrammierungSMS OTP API Ownership: 6 Rate Limit Rules for SaaS Login Recovery(29.09.2026 um 05:55 Uhr)
•
Sichere ProgrammierungHow I Review AI-Generated HTML Before Publishing It(29.09.2026 um 05:58 Uhr)
•
Sichere ProgrammierungAI - Weights(29.09.2026 um 05:59 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

Doubly Linked Lists - DSA Notes 📝

🎯 Learning Goals What are doubly linked lists? What are its operations’ time complexities? 🧠 Key Concepts (aka My Notes) Two pointers (next and prev) Null prev means it is the head of the list Inserti…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




🎯 Learning Goals




  • What are doubly linked lists?

  • What are its operations’ time complexities?









🧠 Key Concepts (aka My Notes)




  • Two pointers (next and prev)


    • Null prev means it is the head of the list











Insertion at End




  • Same as Singly Linked

  • But, make sure to update prev pointer too

  • The order is important


    • Don’t update the tail pointer without updating the old tail’s next and NewListNode’s prev)









tail.next = NewListNode
NewListNode.prev = tail
# Update tail pointers
tail = tail.next






⌚ Time complexity is O(1)






Deletion at End




  • Deletion means just not having anything point to that last node

  • For this one, important to save the pointer to the node before the tail


    • So that, we can set the tail pointer to that node.








Here, ListNode2 is just a variable name. It can be temp or anything.




ListNode2 = tail.prev
ListNode2.next = null
tail = ListNode2






⌚ Time complexity is O(1)




O(1) insertion and deletion means that theoretically we can use these guys are implement Stacks.







Access




  • Same as Singly Linked List, but can go both directions



⌚ Time complexity is O(n)






⌚ Time Complexities




























Operation Big-O
Access O(n)
Search O(n)
Insertion (end) O(1)
Deletion (end) O(1)





💪 LeetCode Problems




  • 707. Design Linked List (Link)

  • 1472. Design Browser History (Link)

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Doubly Linked Lists - DSA Notes 📝

Thematisch verwandte Begriffe: Doubly, Linked, Lists, Notes · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-101093 | Cotonti through 1.0.0 contains a cross-site request forgery vulnerabili…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag