Browse Source

Formatting

content-update
Frenchris 5 years ago committed by GitHub
parent
commit
c2603e89c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      subjects/sortlist.en.md

12
subjects/sortlist.md → subjects/sortlist.en.md

@ -14,17 +14,17 @@ func SortList(l *node, func cmp(a,b int) bool) *node{
} }
``` ```
This function must sort the list given as a parameter, using the function `cmp` to select the order to apply, and returns a pointer to the first element of the sorted list. This function must sort the list given as a parameter using the function `cmp` to select the order to apply. It must then return a pointer to the first element of the sorted list.
- Duplications must remain. - Duplications must remain.
- Inputs will always be consistet. - Inputs will always be consistent.
- You must use the type `Node` - The type `Node` must be used.
- Functions passed as `cmp` will always return a boolean. If `a` and `b` are in the rigth order it returns `true`, otherwise it returns `false`. - Functions passed as `cmp` will always return a boolean. If `a` and `b` are in the right order it returns `true`, otherwise it returns `false`.
- For example, the following function used as cmp will sort the list in ascending order : - For example; the following function used as cmp will sort the list in ascending order :
```go ```go
func ascending(a, b int) { func ascending(a, b int) {
@ -34,4 +34,4 @@ func ascending(a, b int) {
return false return false
} }
} }
``` ```
Loading…
Cancel
Save