Add some cool queue, stacks, strings, math, bit manipulation examples (#35)

This commit is contained in:
Dr. Marina Souza, PhD 2023-07-16 17:35:14 -07:00 committed by GitHub
parent f3ee2cdf52
commit 0f455a0322
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 932 additions and 13 deletions

View file

@ -2,7 +2,7 @@
__author__ = "bt3"
def binary_serch_counting(lst1, k, lo=0, hi=None):
def binary_search_counting(lst1, k, lo=0, hi=None):
if hi is None: hi = len(lst1)
while lo < hi:
mid = (lo+hi)//2
@ -24,7 +24,7 @@ def find_time_occurrence_list(seq, k):
the dict is fixed. Another way, since the array is sorted, it to
use binary search, since this is only O(logn).
"""
index_some_k = binary_serch_counting(seq, k)
index_some_k = binary_search_counting(seq, k)
count = 1
sizet = len(seq)