Browse Source

adding: instructions to memory management subjects

content-update
lee 3 years ago
parent
commit
50e5fe0e80
  1. 2
      subjects/arrange_it/README.md
  2. 8
      subjects/name_initials/README.md
  3. 4
      subjects/string_literals/README.md

2
subjects/arrange_it/README.md

@ -5,7 +5,7 @@
Create a **function** called `arrange_phrase` that takes a string literal as a phrase and returns it organized
Each word will have a number that indicates the position of that word.
> This exercise will test the **heap allocation** of your function!
> This exercise will test how many times the **heap is going to be allocated**!\
> So try your best to allocate the minimum data on the heap!
### Expected Function

8
subjects/name_initials/README.md

@ -5,7 +5,7 @@
Create a **function** called `initials`, this function will receive a vector of string literals
with names and return a vector of Strings with the initials of each name.
> This exercise will test the **heap allocation** of your function!
> This exercise will test how many times the **heap is going to be allocated**!\
> So try your best to allocate the minimum data on the heap!
### Notions
@ -15,7 +15,7 @@ with names and return a vector of Strings with the initials of each name.
### Expected Function
```rust
pub fn initials(names: &mut Vec<&str>) -> Vec<String> {
pub fn initials(names: Vec<&str>) -> Vec<String> {
}
```
@ -27,8 +27,8 @@ Here is a program to test your function:
use name_initials::initials;
fn main() {
let mut names = vec!["Harry Potter", "Someone Else", "J. L.", "Barack Obama"]
println!("{:?}", initials(&mut names));
let names = vec!["Harry Potter", "Someone Else", "J. L.", "Barack Obama"]
println!("{:?}", initials(names));
}
```

4
subjects/string_literals/README.md

@ -10,8 +10,8 @@ Create the following functions:
- `split_at`, that divides a string in two returning a tuple
- `find', that returns the index if the first character of a given string that matches the pattern
> This exercise will test the **heap allocation** of your function!
> So try your best to allocate the minimum data on the heap! (hit: &str)
> This exercise will test how many times the **heap is going to be allocated**!\
> So try your best to allocate the minimum data on the heap!
### Notions

Loading…
Cancel
Save