Files
beyond-interviews/analysis/04-reverse-linked-list/exapmle/reverse-linked-list/README.md

30 lines
459 B
Markdown

# 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
```
## Memory walkthrough
see memory_walkthrough.md