From 622d4deeae4a32452a2eaebf21f7ac09db457736 Mon Sep 17 00:00:00 2001 From: Int Fract Date: Wed, 28 Jun 2023 08:11:20 +0000 Subject: [PATCH] added comments and documentation --- algorithms/Python/README.md | 1 + algorithms/Python/arrays/sorted_insert.py | 1 + 2 files changed, 2 insertions(+) diff --git a/algorithms/Python/README.md b/algorithms/Python/README.md index 56e61288..309745a9 100644 --- a/algorithms/Python/README.md +++ b/algorithms/Python/README.md @@ -8,6 +8,7 @@ - [Remove duplicate items](arrays/remove_duplicates_list.py) - [Dutch National Flag Algorithm](arrays/dutch_national_flag_algo.py) - [Max Sub Array Sum](arrays/max_sub_array_sum.py) +- [Sorted Insert](arrays/sorted_insert.py) ## Linked Lists - [Doubly](linked_lists/doubly.py) diff --git a/algorithms/Python/arrays/sorted_insert.py b/algorithms/Python/arrays/sorted_insert.py index 3b78222f..0eecac44 100644 --- a/algorithms/Python/arrays/sorted_insert.py +++ b/algorithms/Python/arrays/sorted_insert.py @@ -6,6 +6,7 @@ Space Complexity : O(1) import math +# find the insertion position of an element in a sorted list def sortedIndex(a: list, item): start = 0 end = len(a)