Skip to content

Commit 9f61330

Browse files
author
Lucian Tash
committed
Update time_complexities.json
1 parent 12827a7 commit 9f61330

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

src/time_complexities.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,9 @@
456456
},
457457

458458
"OpenHash": {
459-
"Double Hash Add": {
459+
"Add": {
460460
"worst": {
461-
"big_o": "O(n^2)",
461+
"big_o": "O(n²)",
462462
"explanation": "Resize by adding $n$ entries and $n$ probes are needed each",
463463
"example": "[null, 0, 1, 2, 3, null, null] add 4, h1 always returns 1, q = 2"
464464
},
@@ -473,7 +473,7 @@
473473
"example": "[0, 1, null, 10, null, null, 6] find 10, q = 11"
474474
}
475475
},
476-
"Double Hash Remove": {
476+
"Remove": {
477477
"worst": {
478478
"big_o": "O(n)",
479479
"explanation": "Collisions cause $n$ probings",
@@ -490,7 +490,7 @@
490490
"example": "[0, 1, null, 10, null, null, 6] find 10, q = 11"
491491
}
492492
},
493-
"Double Hash Find": {
493+
"Find": {
494494
"worst": {
495495
"big_o": "O(n)",
496496
"explanation": "Collisions cause $n$ probings",
@@ -627,12 +627,12 @@
627627
"BubbleSort": {
628628
"BubbleSort without Last Swap Optimization": {
629629
"worst": {
630-
"big_o": "O(n^2)",
630+
"big_o": "O(n²)",
631631
"explanation": "must swap n data n times each",
632632
"example": "[5, 4, 3, 2, 1]"
633633
},
634634
"average": {
635-
"big_o": "O(n^2)",
635+
"big_o": "O(n²)",
636636
"explanation": "on average, half data is unsorted thus n/2 swaps for n items",
637637
"example": "[1, 4, 3, 5, 2]"
638638
},
@@ -644,12 +644,12 @@
644644
},
645645
"BubbleSort with Last Swap Optimization": {
646646
"worst": {
647-
"big_o": "O(n^2)",
647+
"big_o": "O(n²)",
648648
"explanation": "Optimization has not effect on worst case runtime",
649649
"example": "[5, 4, 3, 2, 1]"
650650
},
651651
"average": {
652-
"big_o": "O(n^2)",
652+
"big_o": "O(n²)",
653653
"explanation": "While optimization does increase average runtime efficiency, it is not enough to affect Big O.",
654654
"example": "[1, 4, 3, 5, 2]"
655655
},
@@ -664,12 +664,12 @@
664664
"CocktailSort": {
665665
"CocktailSort without Last Swap Optimization": {
666666
"worst": {
667-
"big_o": "O(n^2)",
667+
"big_o": "O(n²)",
668668
"explanation": "Must check n times for n items",
669669
"example": "[5, 4, 3, 2, 1]"
670670
},
671671
"average": {
672-
"big_o": "O(n^2)",
672+
"big_o": "O(n²)",
673673
"explanation": "Must check on average n/2 times for n items",
674674
"example": "[1, 4, 3, 5, 2]"
675675
},
@@ -681,12 +681,12 @@
681681
},
682682
"CocktailSort with Last Swap Optimization": {
683683
"worst": {
684-
"big_o": "O(n^2)",
684+
"big_o": "O(n²)",
685685
"explanation": "Optimization has no effect on the worst-case runtime",
686686
"example": "[5, 4, 3, 2, 1]"
687687
},
688688
"average": {
689-
"big_o": "O(n^2)",
689+
"big_o": "O(n²)",
690690
"explanation": "While optimization increases average runtime it is not enough to effect Big O",
691691
"example": "[1, 4, 3, 5, 2]"
692692
},
@@ -701,12 +701,12 @@
701701
"InsertionSort": {
702702
"InsertionSort": {
703703
"worst": {
704-
"big_o": "O(n^2)",
704+
"big_o": "O(n²)",
705705
"explanation": "n checks for each item where there are n items",
706706
"example": "[6, 5, 4, 3, 2, 1]"
707707
},
708708
"average": {
709-
"big_o": "O(n^2)",
709+
"big_o": "O(n²)",
710710
"explanation": "n/2 checks for each item where there are n items",
711711
"example": "[6, 1, 4, 2, 5, 3]"
712712
},
@@ -717,11 +717,11 @@
717717
}
718718
}
719719
},
720-
720+
721721
"SelectionSort": {
722722
"SelectionSort": {
723723
"all cases": {
724-
"big_o": "O(n^2)",
724+
"big_o": "O(n²)",
725725
"explanation": "select largest element which is linear time n times",
726726
"example": "[7, 1, 8, 3, 5]"
727727
}

0 commit comments

Comments
 (0)