coderz.py

Keep Coding Keep Cheering!

Hash Table

Implementation of a Hash Table in Python

The idea of a dictionary used as a hash table to get and retrieve items using keys is often referred to as a mapping. Python already has a built-in dictionary object that serves as a Hash Table.

Quick Sort

Implementation of Quick Sort in Python

A quick sort first selects a value, which is called the pivot value. Although there are many different ways to choose the pivot value, we will simply use the first item in the list.

Bubble Sort

Implementation of a Bubble Sort in Python

The bubble sort makes multiple passes through a list. It compares adjacent items and exchanges those that are out of order. Each pass through the list places the next largest value in its proper place. In essence, each item “bubbles” up to the location where it belongs.

Binary Search

Implementation of Binary Search in Python

Binary Search, also known as half-interval search, logarithmic search, or binary chop, is a search algorithm that finds the position of a target value within a sorted array. Binary search compares the target value to the middle element of the array.

Advertisement