1/14
Looks like no tags are added yet.
Search Algorithm
An algorithm that looks for data stored within a data set, such as a string or a list.
Big-O Notation
An algebraic notation written as O(algebraic expression) used by computer scientists to analyze the cost or worst-case time complexity of an algorithm in terms of the data set size n.
Linear Search
A search algorithm that iterates through every element in a data set and compares it to the target value; it should be used when data is not sorted.
Linear Search Time Complexity
An algorithm complexity with a worst-case scenario of O(n), a best-case scenario of O(1), and an average performance of n/2 steps.
Binary Search
A fast searching algorithm usable only on sorted lists that continuously compares the target to the middle element and eliminates the half of the list where the target cannot be.
Binary Search Time Complexity
A time complexity of O(logn), requiring at most 20 steps to find an item in a list of 1,000,000 numbers compared to up to 1,000,000 steps for a linear search.
bisect_left
A method imported from Python's bisect module that performs a binary search to find the index of an element in a sorted list, or returns the index where it would be placed if it is absent.
Sorting Algorithm
An algorithm used to arrange the data in an iterable in a meaningful way, such as numerical, alphabetical, or by length.
Bubble Sort
A sorting algorithm that iterates through a list, compares adjacent numbers, and swaps them if they are out of order so that the largest values bubble up to the end of the list.
Bubble Sort Inner Loop
The loop within a bubble sort algorithm where all adjacent comparisons and swapping operations take place.
Bubble Sort Outer Loop
The loop within a bubble sort algorithm that keeps the algorithm running for as many complete passes as needed to put the list in order.
Bubble Sort Complexity
A time complexity of O(n2) caused by two nested for loops, making it simple to implement and acceptable for small data sets, but inefficient for large data sets.
Insertion Sort
A sorting algorithm that splits a list into a sorted left portion and an unsorted right portion, placing each current element from the right into its proper position on the left.
Insertion Sort Efficiency
A sorting algorithm with a general complexity of O(n2) that is favored over bubble sort because it achieves O(n) efficiency when the list is almost sorted.
sorted() Function
Python's built-in sorting function that utilizes a hybrid algorithm combining two or more sorting methods, supporting arguments such as reverse=True and