We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Sorting
- Big Sorting
- Discussions
Big Sorting
Big Sorting
Sort by
recency
|
948 Discussions
|
Please Login in order to post a comment
MERGE SORT IS still the fastest algorithm since o(n) complexity
this is insertion sort (0)^2 ` def compare(res, current): if len(res) == 0: res = [current] return res for idx, pip in enumerate(res): if pip >= current: rep = idx if rep<0: rep = 0 res.insert(rep, current) return res res.append(current) print("final", res) return res
def bigSorting(unsorted): # Write your code here res =[] for datas in unsorted: data = int(datas) res = compare(res,data) fix = [] for bub in res: fix.append(str(bub)) print(bub) return fix `
Here is my c++ solution, you can watch the explanation here : https://youtu.be/GAvltofMdYc
Python3, tried this way
B