Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3963 from nalinbhardwaj/sorting
Browse files Browse the repository at this point in the history
Array Sorting Cheat Sheet: Improvements
  • Loading branch information
mintsoft authored Feb 22, 2017
2 parents 1b2eb82 + 86d781b commit 98e623b
Showing 1 changed file with 96 additions and 25 deletions.
121 changes: 96 additions & 25 deletions share/goodie/cheat_sheets/json/array-sorting.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,67 @@
{
"id": "array_sorting_cheat_sheet",
"name": "Array Sorting Algorithms",
"description": "Summary of Big-O time complexities for Array Sorting Algorithms",
"description": "Summary of Big-O time and memory complexities for Array Sorting Algorithms when n = size of array, k = range of elements",
"metadata": {
"sourceName": "Wikipedia",
"sourceUrl": "https://en.wikipedia.org/wiki/Sorting_algorithm"
},
"aliases": [
"array sorting algorithms", "array sorting algorithm", "sorting complexity"

"array sorting algorithms", "array sorting algorithm", "sorting complexity", "sorting time complexity", "sorting memory complexity", "sorting algorithmic complexity", "sorting time", "sorting memory", "sorting algorithm",
"array sort", "array sort algorithms", "array sort algorithm", "sort complexity", "sort time complexity", "sort memory complexity", "sort algorithmic complexity", "sort time", "sort memory", "sort algorithm"
],
"template_type": "code",
"section_order": [
"Quick Sort",
"Merge Sort",
"Heap Sort",
"Tim Sort",
"Bubble Sort",
"Insertion Sort",
"Selection Sort",
"Tree Sort",
"Shell Sort",
"Bucket Sort",
"Radix Sort",
"Counting Sort",
"Tim Sort",
"Shell Sort",
"Tree Sort",
"Comb Sort",
"Cube Sort"
],
"sections": {
"Quick Sort": [
{
"val": "n log( n )",
"val": "n log( n )",
"key": "Best"
},
{
"val": "n log( n )",
"val": "n log( n )",
"key": "Average"
},
{
"val": "",
"key": "Worst"
},
{
"val": "n",
"key": "Auxiliary memory"
}
],
"Merge Sort": [
{
"val": "n log( n )",
"val": "n log( n )",
"key": "Best"
},
{
"val": "n log( n )",
"val": "n log( n )",
"key": "Average"
},
{
"val": "n log( n )",
"val": "n log( n )",
"key": "Worst"
},
{
"val": "n",
"key": "Auxiliary memory"
}
],
"Tim Sort": [
Expand All @@ -62,25 +71,33 @@
},
{
"key":"Average",
"val":"n log( n )"
"val":"n log( n )"
},
{
"key":"Worst",
"val":"n log( n )"
"val":"n ⋅ log( n )"
},
{
"val": "n",
"key": "Auxiliary memory"
}
],
"Heap Sort": [
{
"val": "n log( n )",
"val": "n log( n )",
"key": "Best"
},
{
"val": "n log( n )",
"val": "n log( n )",
"key": "Average"
},
{
"val": "n log( n )",
"val": "n log( n )",
"key": "Worst"
},
{
"val": "Constant",
"key": "Auxiliary memory"
}
],
"Bubble Sort": [
Expand All @@ -95,6 +112,10 @@
{
"val": "",
"key": "Worst"
},
{
"val": "Constant",
"key": "Auxiliary memory"
}
],
"Insertion Sort": [
Expand All @@ -109,6 +130,10 @@
{
"val": "",
"key": "Worst"
},
{
"val": "Constant",
"key": "Auxiliary memory"
}
],
"Selection Sort": [
Expand All @@ -123,20 +148,28 @@
{
"val": "",
"key": "Worst"
},
{
"val": "Constant",
"key": "Auxiliary memory"
}
],
"Tree Sort": [
{
"key":"Best",
"val":"n log( n )"
"val":"n log( n )"
},
{
"key":"Average",
"val":"n log( n )"
"val":"n log( n )"
},
{
"key":"Worst",
"val":""
},
{
"key":"Auxiliary memory",
"val":"n"
}
],
"Shell Sort": [
Expand All @@ -145,12 +178,16 @@
"key": "Best"
},
{
"val": "( n log( n ) )²",
"val": "( n log( n ) )²",
"key": "Average"
},
{
"val": "( n log( n ) )²",
"val": "( n log( n ) )²",
"key": "Worst"
},
{
"val": "Constant",
"key": "Auxiliary memory"
}
],
"Bucket Sort": [
Expand All @@ -165,20 +202,28 @@
{
"val": "",
"key": "Worst"
},
{
"val": "n ⋅ k",
"key": "Auxiliary memory"
}
],
"Radix Sort": [
{
"val": "nk",
"val": "n ⋅ k",
"key": "Best"
},
{
"val": "nk",
"val": "n ⋅ k",
"key": "Average"
},
{
"val": "nk",
"val": "n ⋅ k",
"key": "Worst"
},
{
"val": "n + k",
"key": "Auxiliary memory"
}
],
"Counting Sort": [
Expand All @@ -193,6 +238,28 @@
{
"key":"Worst",
"val":"n + k"
},
{
"key":"Auxiliary memory",
"val":"n + k"
}
],
"Comb Sort": [
{
"key":"Best",
"val":"n ⋅ log( n )"
},
{
"key":"Average",
"val":"n² / 2ᵖ where p = number of increments"
},
{
"key":"Worst",
"val":""
},
{
"key":"Auxiliary memory",
"val":"Constant"
}
],
"Cube Sort": [
Expand All @@ -202,11 +269,15 @@
},
{
"key":"Average",
"val":"n log( n )"
"val":"n log( n )"
},
{
"key":"Worst",
"val":"n log( n )"
"val":"n ⋅ log( n )"
},
{
"key":"Auxiliary memory",
"val":"n"
}
]
}
Expand Down

0 comments on commit 98e623b

Please sign in to comment.