Skip to content

Commit

Permalink
refactor(structure:linkedlist): renamed variable in singlylinkedlist.…
Browse files Browse the repository at this point in the history
…go (#772)

Co-authored-by: Rak Laptudirm <[email protected]>
  • Loading branch information
egbakou and raklaptudirm authored Dec 31, 2024
1 parent 82b6e96 commit fd60614
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 fd60614

Please sign in to comment.