<jupyter_start><jupyter_text>Simple sequential search<jupyter_code>def seqSearch(l,item):
    pos = 0
    found = False
    
    while pos < len(l) and not found:
        if item == l[pos]:
            found = True
        else:
            pos += 1
            
    return found

list1 = [1,2,3,4,5,6,7]
print(seqSearch(list1,3))
print(seqSearch(list1,'F'))<jupyter_output>True
False<jupyter_text>Binary Search of an Ordered List<jupyter_code>def binSearch(inputList,item):
    
    found = False
    pos = len(inputList) //2
    rightLim = len(inputList)
    leftLim = 0
    prev_pos = -1
    
    
    while prev_pos != pos:
        prev_pos = pos
        if inputList[pos] == item:
            return True
        if inputList[pos] < item:
            leftLim = pos
            pos = leftLim + (rightLim - leftLim) // 2
        else:  #inputList[pos] > item
            rightLim = pos
            pos = leftLim + (rightLim - leftLim) // 2
#         print leftLim, rightLim
            
    return found
        
ll = [0,1,2,3,5,6,7,8,10]
print(binSearch(ll,8))<jupyter_output>True
{'fraction_non_alphanumeric': 0.11254612546125461, 'fraction_numerical': 0.026752767527675275, 'mean_word_length': 1.9889807162534436, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '361552', 'license': 'MIT', 'n_tokens_mistral': 384, 'n_tokens_neox': 376, 'n_words': 84, 'path': 'notebooks/Search.ipynb', 'repo_name': 'jfbg/insight', 'size': '1084'}