Data structures and Algorithm problems solved using python3. All problems are being followed from the udemy course The Ultimate Python Coding Interview & Computer Science Bootcamp.
-
Linked List: A linked list is a linear collection of data elements whose order is not given by their physical placement in memory. Instead, each element points to the next.
-
Doubly Linked List: A doubly linked list is a linked data structure that consists of a set of sequentially linked records called nodes. Each node contains three fields: two link fields and one data field.
-
Stack: A stack is a linear data structure that follows the principle of Last In First Out (LIFO).
-
Queue: A Queue is a linear structure which follows a particular order in which the operations are performed. The order is First In First Out (FIFO).
-
Binary Search Tree: A binary search tree, also called an ordered or sorted binary tree, is a rooted binary tree data structure with the key of each internal node being greater than all the keys in the respective node's left subtree and less than the ones in its right subtree.
-
Hash Table: A hash table, also known as hash map or dictionary, is a data structure that implements a set abstract data type, a structure that can map keys to values. A hash table uses a hash function to compute an index, also called a hash code, into an array of buckets or slots, from which the desired value can be found. During lookup, the key is hashed and the resulting hash indicates where the corresponding value is stored.
-
Graph: A Graph is a non-linear data structure consisting of nodes and edges. The nodes are sometimes also referred to as vertices and the edges are lines or arcs that connect any two nodes in the graph.
- Recursion: The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called a recursive function.
-
Bubble Sort: Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in the wrong order.
-
Insertion Sort: Insertion sort is a simple sorting algorithm that works similar to the way you sort playing cards in your hands. The array is virtually split into a sorted and an unsorted part. Values from the unsorted part are picked and placed at the correct position in the sorted part.
-
Selection Sort: Selection sort is a sorting algorithm that selects the smallest element from an unsorted list in each iteration and places that element at the beginning of the unsorted list.
-
Merge Sort: The Merge Sort algorithm is a sorting algorithm that is considered an example of the divide and conquer strategy. More about Merge sort.
-
Quick Sort: QuickSort is a Divide and Conquer algorithm. It picks an element as a pivot and partitions the given array around the picked pivot. More about Quick sort.
-
Breadth First Search: Breadth-First Traversal (or Search) for a graph is similar to Breadth-First Traversal of a tree. The only catch here is, that, unlike trees, graphs may contain cycles, so we may come to the same node again. More about BFS.
-
Depth First Search: Depth-first search is an algorithm for traversing or searching tree or graph data structures. The algorithm starts at the root node and explores as far as possible along each branch before backtracking.
Time and Space Complexity CheatSheet
Sources: Wikipedia, GeeksForGeeks, JavaTpoint.