Skip to content

Commit 6c73ab7

Browse files
docs(insertion-sort): added import statement (#3004)
* added import statement --------- Co-authored-by: Pedro Ferreira <me.pedro.ferreira@gmail.com>
1 parent 4e92258 commit 6c73ab7

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

subjects/insertion_sort/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Implement the insertion-sort algorithm by creating a function named `insertion_sort`. It should execute the iterations of the algorithm **up to** the number indicated by `steps`. See the **Usage** for more information.
66

7-
The insertion-sort algorithm sorts an array of size `n` in ascending order.
7+
The insertion-sort algorithm sorts an array of size `n` in ascending order.
88

99
1. Iterates over the slice from `slice[1]` to `slice[n]`.
1010

@@ -32,6 +32,8 @@ pub fn insertion_sort(slice: &mut [i32], steps: usize) {
3232
Here is a possible program to test your function,
3333

3434
```rust
35+
use insertion_sort::insertion_sort;
36+
3537
fn main() {
3638
let mut target = [5, 3, 7, 2, 1, 6, 8, 4];
3739
// executes the first iteration of the algorithm

subjects/insertion_sort/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use insertion_sort::insertion_sort;
2+
13
fn main() {
24
let mut target = [5, 3, 7, 2, 1, 6, 8, 4];
35
// executes the first iteration of the algorithm

0 commit comments

Comments
 (0)