Skip to content
Snippets Groups Projects
Verified Commit d39d353b authored by orestis.malaspin's avatar orestis.malaspin
Browse files

typos

parent 302f919e
Branches
No related tags found
No related merge requests found
......@@ -228,6 +228,8 @@ sorted_list sorted_list_extract(sorted_list list, int val) {
# La recherche
```C
element* sorted_list_search(sorted_list list, int val);
```
......@@ -243,7 +245,7 @@ element* sorted_list_search(sorted_list list, int val) {
element* pos = sorted_list_position(list, val);
if (NULL == pos && val == list->data) {
return list; // first element contains val
} else if (NULL != pos->next && val == pos->next->data) {
} else if (NULL != pos && NULL != pos->next && val == pos->next->data) {
return pos->next; // non-first element contains val
} else {
return NULL; // well... val's not here
......@@ -277,7 +279,7 @@ element* sorted_list_position(sorted_list list, int val) {
if (sorted_list_is_empty(list) || val <= list->data) {
pos = NULL;
} else {
while (NULL != pos->next && val > pos->next>data) {
while (NULL != pos->next && val > pos->next->data) {
pos = pos->next;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment