Ref: 2 - added example

This commit is contained in:
2026-06-17 17:40:27 -04:00
parent e1ef02c4a6
commit 939935c258
5 changed files with 327 additions and 0 deletions

View File

@@ -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
```