added comments and documentation
parent
caf780f785
commit
622d4deeae
|
@ -8,6 +8,7 @@
|
||||||
- [Remove duplicate items](arrays/remove_duplicates_list.py)
|
- [Remove duplicate items](arrays/remove_duplicates_list.py)
|
||||||
- [Dutch National Flag Algorithm](arrays/dutch_national_flag_algo.py)
|
- [Dutch National Flag Algorithm](arrays/dutch_national_flag_algo.py)
|
||||||
- [Max Sub Array Sum](arrays/max_sub_array_sum.py)
|
- [Max Sub Array Sum](arrays/max_sub_array_sum.py)
|
||||||
|
- [Sorted Insert](arrays/sorted_insert.py)
|
||||||
|
|
||||||
## Linked Lists
|
## Linked Lists
|
||||||
- [Doubly](linked_lists/doubly.py)
|
- [Doubly](linked_lists/doubly.py)
|
||||||
|
|
|
@ -6,6 +6,7 @@ Space Complexity : O(1)
|
||||||
|
|
||||||
import math
|
import math
|
||||||
|
|
||||||
|
# find the insertion position of an element in a sorted list
|
||||||
def sortedIndex(a: list, item):
|
def sortedIndex(a: list, item):
|
||||||
start = 0
|
start = 0
|
||||||
end = len(a)
|
end = len(a)
|
||||||
|
|
Loading…
Reference in New Issue