Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/r100-stack/level-order-traversal-of-a-binary-tree
https://github.com/r100-stack/level-order-traversal-of-a-binary-tree
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/r100-stack/level-order-traversal-of-a-binary-tree
- Owner: r100-stack
- Created: 2020-09-30T02:26:01.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-30T03:01:47.000Z (over 4 years ago)
- Last Synced: 2025-01-01T07:08:06.651Z (26 days ago)
- Language: C
- Size: 324 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Level Order Traversal of a Binary Tree
This code covers how the do a level order traversal of a binary tree. To accomplish this, we use the help of a queue.
## Structure
1. queue.c: Contains the implementation for Queue and Node
2. level_order_traversal_of_binary_tree.c: Contains the main() that does the level order traversal of the binary tree shown in [sample_binary_tree.jpg (Below)](sample_binary_tree.jpg).## How to run the code (on Linux/Mac, use GitBash for Windows)
To compile the code
```
gcc -o ./executables/level_order_traversal_of_binary_tree level_order_traversal_of_binary_tree.c
```To run the code
```
./executables/level_order_traversal_of_binary_tree
```## Sample Output
```
$ ./executables/level_order_traversal_of_binary_trees.exe
Binary tree in level order: 15 11 17 5 13 16 1 12
```