-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: ci | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
permissions: | ||
contents: write | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Configure Git Credentials | ||
run: | | ||
git config user.name github-actions[bot] | ||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
with: | ||
key: mkdocs-material-${{ env.cache_id }} | ||
path: .cache | ||
restore-keys: | | ||
mkdocs-material- | ||
- run: pip install mkdocs-material | ||
- run: mkdocs gh-deploy --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# bin_tree - Binary Tree documentation | ||
|
||
## Local Compilation | ||
|
||
To test your changes on your computer before submission: | ||
|
||
1. Install Python | ||
- On Windows, check the option to add Python to the PATH during installation. | ||
|
||
2. Clone the repository and open a terminal in the cloned folder. | ||
|
||
3. Install the necessary tools with: | ||
```bash | ||
pip3 install -r requirements.txt | ||
``` | ||
|
||
4. Start a server that automatically compiles the changes: | ||
```bash | ||
mkdocs serve | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# Binary Tree Operations | ||
|
||
This module provides operations for manipulating binary trees. | ||
|
||
## Type Definition | ||
|
||
```ocaml | ||
type 'a bin_tree = Nil | Node of 'a * 'a bin_tree * 'a bin_tree | ||
``` | ||
|
||
Represents a binary tree where each node contains a value of type `'a` and has two child nodes. | ||
|
||
## Functions | ||
|
||
### `height` | ||
|
||
```ocaml | ||
val height : 'a bin_tree -> int | ||
``` | ||
|
||
Returns the height of the given binary tree. | ||
|
||
### `nb_leaf` | ||
|
||
```ocaml | ||
val nb_leaf : 'a bin_tree -> int | ||
``` | ||
|
||
Returns the number of leaves in the given binary tree. | ||
|
||
### `nb_internal_nodes` | ||
|
||
```ocaml | ||
val nb_internal_nodes : 'a bin_tree -> int | ||
``` | ||
|
||
Returns the number of internal nodes in the given binary tree. | ||
|
||
### `internal_nodes` | ||
|
||
```ocaml | ||
val internal_nodes : 'a bin_tree -> 'a list | ||
``` | ||
|
||
Returns a list of internal nodes in the given binary tree. | ||
|
||
### `search_node` | ||
|
||
```ocaml | ||
val search_node : 'a bin_tree -> 'a -> bool | ||
``` | ||
|
||
Checks if the given value exists in the binary tree. | ||
|
||
### `is_symmetric` | ||
|
||
```ocaml | ||
val is_symmetric : 'a bin_tree -> bool | ||
``` | ||
|
||
Checks if the binary tree is symmetric. | ||
|
||
### `is_strict` | ||
|
||
```ocaml | ||
val is_strict : 'a bin_tree -> bool | ||
``` | ||
|
||
Checks if the binary tree is strict. | ||
|
||
### `is_right_comb` | ||
|
||
```ocaml | ||
val is_right_comb : 'a bin_tree -> bool | ||
``` | ||
|
||
Checks if the binary tree is a right comb. | ||
|
||
### `is_left_comb` | ||
|
||
```ocaml | ||
val is_left_comb : 'a bin_tree -> bool | ||
``` | ||
|
||
Checks if the binary tree is a left comb. | ||
|
||
### `is_comb` | ||
|
||
```ocaml | ||
val is_comb : 'a bin_tree -> bool | ||
``` | ||
|
||
Checks if the binary tree is a comb. | ||
|
||
### `is_perfect` | ||
|
||
```ocaml | ||
val is_perfect : 'a bin_tree -> bool | ||
``` | ||
|
||
Checks if the binary tree is perfect. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
site_name: Documentation bin_tree | ||
repo_url: https://github.com/Ahhj93/bin_tree-docs | ||
repo_name: Ahhj93/bin_tree-docs | ||
|
||
theme: | ||
name: material | ||
palette: | ||
- media: "(prefers-color-scheme)" | ||
toggle: | ||
icon: material/link | ||
name: Switch to light mode | ||
- media: "(prefers-color-scheme: light)" | ||
scheme: default | ||
primary: indigo | ||
accent: indigo | ||
toggle: | ||
icon: material/toggle-switch | ||
name: Switch to dark mode | ||
- media: "(prefers-color-scheme: dark)" | ||
scheme: slate | ||
primary: black | ||
accent: indigo | ||
toggle: | ||
icon: material/toggle-switch-off | ||
name: Switch to system preference | ||
font: | ||
text: Roboto | ||
code: Roboto Mono |