Ref: 2 - added example
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# Reverse Linked List Example
|
||||
|
||||
This directory contains a small standalone C++ example for the classic three-pointer linked list reversal algorithm.
|
||||
|
||||
## Build
|
||||
|
||||
```bash
|
||||
g++ -std=c++17 -Wall -Wextra -pedantic main.cpp -o reverse_linked_list
|
||||
```
|
||||
|
||||
## Run
|
||||
|
||||
```bash
|
||||
./reverse_linked_list
|
||||
```
|
||||
|
||||
## Expected Output
|
||||
|
||||
```text
|
||||
Original list:
|
||||
1 -> 2 -> 3 -> 4 -> 5 -> null
|
||||
|
||||
Reversed list:
|
||||
5 -> 4 -> 3 -> 2 -> 1 -> null
|
||||
```
|
||||
Reference in New Issue
Block a user