You are viewing a single comment's thread. Return to all comments →
Swift
func quickSort(arr: [Int]) -> [Int] { var leftArr: [Int] = [] var equalArr: [Int] = [] var rigthArr: [Int] = [] let checkValue = arr[0] for item in arr { if item < checkValue { leftArr.append(item) } else if checkValue == item { equalArr.append(item) } else { rigthArr.append(item) } } return leftArr + equalArr + rigthArr }
Seems like cookies are disabled on this browser, please enable them to open this website
Quicksort 1 - Partition
You are viewing a single comment's thread. Return to all comments →
Swift