Skip to content

Commit

Permalink
fix typo and missing link to image.
Browse files Browse the repository at this point in the history
  • Loading branch information
kurniawano committed Feb 21, 2025
1 parent 5f89971 commit 9d6e865
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
12 changes: 7 additions & 5 deletions docs/02-heap-complexity/binary-heap.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ Binary heap is a complete binary tree-based data structure that satisfies the he
### Goals

By the end of this lesson, you should be able to:
- Implement **binary heap** using Python's built-in list
- Describe **heap property**
- Describe the steps to **build heap**
- Implement algorithm to restore **heap property**
- Write functions to do **binary heap** data structure operation
- Implement a **binary heap** using Python's built-in list.
- Describe **heap property**.
- Write functions to do **binary heap** data structure operations.
- Implement algorithm to restore the **heap property**.
- Describe the steps to **build a heap**.



:::keyword Keywords
`tree`, `binary tree`, `root`, `binary heap`, `heap property`, `heapify`, `node`, `leaf`, `parent node`, `child node`
Expand Down
14 changes: 8 additions & 6 deletions docs/02-heap-complexity/computation-time.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ Computation time, also known as runtime or execution time, refers to the amount

By the end of this lesson, you should be able to:

- Define **Big-O** notation and other asymptotic notations
- Derive **complexity** of a code using its computation model
- **Measure** computation time for bubble sort, insertion sort, built-in sort, and heapsort
- Create **plots** from array data for **visualising** computational time
- Define **Big-O** notation and other asymptotic notations.
- Derive **complexity** of a code using its computation model.
- **Measure** computation time for bubble sort, insertion sort, built-in sort, and heapsort.
- Create **plots** from array data for **visualising** computational time.

:::keyword Keywords
`complexity`, `time complexity`, `asymptotic notation`, `computation time`, `computational model`, `logarithmic`, `linear`, `log-linear`, `quadratic`, `polynomial`, `exponential`
Expand Down Expand Up @@ -598,12 +598,14 @@ $T(n) = O(n\log(n))$

## Computational Time Summary

In summary, different algorithm may have different performance in terms of computational time. The following image shows the different plots for some common computational time in computing.
In summary, different algorithm may have different performance in terms of computational time. The following image shows the different plots for some common computational time in computing. [^1]

<ImageCard path={"https://interactivepython.org/runestone/books/published/pythonds/_images/newplot.png"} widthPercentage="50%"/>
<ImageCard path={"https://runestone.academy/ns/books/published/pythonds/_images/newplot.png"} widthPercentage="50%"/>

In our examples above, both Bubble Sort and Insertion sort is quadratic while Heapsort is log linear. We can see that Heapsort is much faster as the number of elements grows big.

[^1]: [Problem Solving with Algorithms and Data Structures using Python by Bradley N. Miller, David L. Ranum is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.](https://runestone.academy/ns/books/published/pythonds/index.html?mode=browsing)



## Asymptotic Notation
Expand Down
8 changes: 4 additions & 4 deletions learning-objectives/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ By the end of these lessons, students should be able to:

By the end of these lessons, students should be able to:

- Implement **binary heap** using Python's built-in list.
- Implement a **binary heap** using Python's built-in list.
- Describe **heap property**.
- Describe the steps to **build heap**.
- Implement algorithm to restore **heap property**.
- Write functions to do **binary heap** data structure operation.
- Write functions to do **binary heap** data structure operations.
- Implement algorithm to restore the **heap property**.
- Describe and implement the algorithm to **build a heap**.
- Implement **heapsort** using iteration.
- Define **Big-O** notation and other asymptotic notations.
- Derive **complexity** of a code using Python computation model.
Expand Down

0 comments on commit 9d6e865

Please sign in to comment.