Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cindy Lam
Cindy Lam

Posted on

     

Linked List - Core Algos Overview

Based on my learnings atFormation, I have learned 11 core algorithms for this Linked List data structure. I have grouped them up by similarities:

Group #1:Accumulating elements in a Linked List

  • Count Elements in a Linked List
  • Sum Element Values in a Linked List

Group #2:Finding without the need of a pointer

  • Find a Highest/Max Element Value in a Linked List
  • Find an Element in a sorted Linked List

Group #3:Finding with 2 pointers

  • Find a Middle Element in a Linked List in One Pass
  • Find Kth Element from the End of a Linked List in One Pass

Group #4:Adding element(s)

  • Append an element with a target value to a Linked list
  • Insert a target element in a sorted Linked List (with sentinel*)

Group #5:Removing element(s)

  • Remove a target element in a sorted Linked List (with sentinel*)
  • Remove all elements with a target value in a Linked List (with sentinel*)

Group #6:Reversing elements

  • Reverse a Linked List

Group #7:Summing Linked Lists

  • Sum Two Linked Lists of Equal Length (with sentinel*)

*Sentinel node = It is a node that does not hold any reference/data to a Linked List (can be any value). We will have the pointer points to this node first. This is especially commonly used for inserting and removing Linked List problems

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Learner, Developer, Software Engineer
  • Joined

More fromCindy Lam

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp