Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/github_actions/github-actions-e…
Browse files Browse the repository at this point in the history
…8694c4dd2
  • Loading branch information
raklaptudirm authored Dec 31, 2024
2 parents d9b385c + fd60614 commit d39c4db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions structure/linkedlist/singlylinkedlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ func (ll *Singly[T]) Count() int {

// Reverse reverses the list.
func (ll *Singly[T]) Reverse() {
var prev, Next *Node[T]
var prev, next *Node[T]
cur := ll.Head

for cur != nil {
Next = cur.Next
next = cur.Next
cur.Next = prev
prev = cur
cur = Next
cur = next
}

ll.Head = prev
Expand Down

0 comments on commit d39c4db

Please sign in to comment.