Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ✅ Pattern 06: In-place Reversal of a LinkedList.md #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ✅ Pattern 06: In-place Reversal of a LinkedList.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ console.log(`Nodes of reversed LinkedList are: ${reverseEveryKElements(head, 3).

The problem follows the <b></i>in-place</i> Reversal of a LinkedList</b> pattern and is quite similar to <b>Reverse every K-element Sub-list</b>. The only difference is that we have to skip `K` alternating elements. We can follow a similar approach, and in each iteration after reversing `K` elements, we will skip the next `K` elements.

````class Node {
````js
class Node {
constructor(value, next = null) {
this.value = value
this.next = next
Expand Down