Algorithms Bell Numbers: Number of partitions of a set Bell numbers are a sequence of numbers that describe the number of ways a set with N elements can be partitioned into disjoint, non-empty subsets. Dobinski's Formula Satifaction Sum of Sterling's number of second kind, The Peirce Triangle Method. First few Bell numbers are 1, 1, 2, 5, 15, 52, 203
catalan number Catalan Numbers Catalan Numbers are one of the widest used and evident number patterns. They are named after the Belgian mathematician Eugène Charles Catalan. A sequence of natural numbers that occur in various counting problems. The Catalan numbers are: 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786,
convex hull Chan's Algorithm to find Convex Hull In computational geometry, Chan's algorithm, named after Timothy M. Chan, is an optimal output-sensitive algorithm to compute the convex hull of a set P of n points, in 2- or 3-dimensional space. The algorithm takes O(n log h) time, where h is the number of vertices of the output (the convex hull).
convex hull Graham Scan Algorithm to find Convex Hull Graham's Scan Algorithm is an efficient algorithm for finding the convex hull of a finite set of points in the plane with time complexity O(N log N). The algorithm finds all vertices of the convex hull ordered along its boundary. It uses a stack to detect and remove concavities in the boundary.
convex hull Gift Wrap Algorithm (Jarvis March Algorithm) to find Convex Hull Gift Wrap Algorithm ( Jarvis March Algorithm ) to find the convex hull of any given set of points. We start from the leftmost point (or point with minimum x coordinate value) and we keep wrapping points in a counterclockwise direction. Find pseudocode, implementations, complexity and questions
convex hull Divide and Conquer algorithm to find Convex Hull Divide and Conquer algorithm to find Convex Hull. The key idea is that is we have two convex hull then, they can be merged in linear time to get a convex hull of a larger set of points. It requires to find upper and lower tangent to the right and left convex hulls C1 and C2
java memory management Memory Management in Java: Mark Sweep Compact Copy algorithm The basic strategy to remove unreferenced objects to is identify the life objects and deleting all the remaining objects. This is divided into two phases: Mark and Sweep. Every Garbage Collection algorithm used in Java Virtual Machine starts by finding out all objects that are still alive.
convex hull Quick Hull Algorithm to find Convex Hull Quickhull is a method of computing the convex hull of a finite set of points in the plane. It uses a divide and conquer approach. It was published by C. Barber and D. Dobkin in 1995. average case complexity is considered to be Θ(n * log(n))
java memory management Memory Management in Java: Java Virtual Machine (JVM) Memory Model Understanding Java Virtual Machine Memory Model and Java Memory Management is important to tune applications for better response depending upon situation and to scale applications for serving the entire humanity as the userbase.
java memory management Memory Management in Java: Minor, Major and Full Garbage Collection The various types of Garbage Collection events cleaning out different parts inside heap memory are: Minor garbage collection Major garbage collection Full garbage collection. Analysis of garbage collection events is, also, provided.
greatest common divisor Euclidean Algorithm to Calculate Greatest Common Divisor (GCD) of 2 numbers The Euclid's algorithm (or Euclidean Algorithm) is a method for efficiently finding the greatest common divisor (GCD) of two numbers. The GCD of two integers X and Y is the largest integer that divides both of X and Y (without leaving a remainder).
Algorithms Find primes using Sieve of Eratosthenes Sieve of Eratosthenes is a simple and ancient algorithm (over 2200 years old) used to find the prime numbers up to any given limit. It is one of the most efficient ways to find small prime numbers. Implementations in C, C++, C Sharp, Java, Go, Haskell, JavaScript, PHP and Python.
double ended queue Double Ended Queue (Deque) A double ended queue also called as deque (pronounced as ‘deck’ or ‘dequeue’) is a list in which the elements can be inserted or deleted at either end in constant time.
Algorithms Karatsuba Algorithm (for fast integer multiplication) Karatsuba algorithm is a fast multiplication algorithm that uses a divide and conquer approach to multiply two numbers.
Graph Algorithms Edmonds Karp Algorithm for maximum flow Edmonds–Karp algorithm is an optimized implementation of the Ford–Fulkerson method for computing the maximum flow in a flow network in O(V E^2) time instead of O(E |max_flow|) in case of Ford-Fulkerson algorithm.
Graph Algorithms Dinic's algorithm for Maximum flow in a graph Dinic's algorithm or Dinitz's algorithm is a strongly polynomial algorithm for computing the maximum flow in a flow network. The basic principle is that a Maximum flow = minimum cut and Breadth First Search is used as a sub-routine.
Graph Algorithms Ford Fulkerson Algorithm for Maximum flow in a graph Ford–Fulkerson algorithm is a greedy algorithm that computes the maximum flow in a flow network. The main idea is to find valid flow paths until there is none left, and add them up. It uses Depth First Search as a sub-routine.
Ways to earn free cool Developer Swag on the Internet Get cool developer swag consisting of t-shirts, stickers, balls, platform credit and a pair of socks from cool companies like Google, Amazon, DigitalOcean, DevRant, Codeship and NPM. Bookmark this page to get the lastest and coolest free swag on the market.
Software Engineering Implementing printf and scanf in C Understanding how printf and scanf works internally is the key to writing advance code. Key concepts involved are variable number of arguments in functions using vararg in C. Use of internal buffer to prepare the input or output.
Sorting Algorithms Bead Sort: An algorithm that works faster with hardware implementation Bead sort (gravity sort) is a natural sorting algorithm. Both digital and analog hardware implementations of bead sort can achieve a sorting time of O(n); The implementation of this algorithm tends to be significantly slower in software and can only be used to sort lists of positive integers
Sorting Algorithms Selection Sort Selection sort is a sorting algorithm sorts an array by repeatedly finding the minimum element (considering ascending order) from unsorted part and putting it at the beginning of the unsorted part. It is used when only O(N) swaps can be made and when memory write is a costly operation
Search Algorithms Binary Search Algorithm Binary Search algorithm is an efficient comparison based search algorithm where the key idea is to reduce size of search space by half in every iteration by exploiting a restriction on the search space that it is in sorted order. When suitable, binary search is choose over other search algorithms
Search Algorithms Linear Search algorithm Linear search is a search algorithm inspired by real-life events. Implementations are available in C, C++, Java, C#, Clojure, Go, Haskell, JavaScript, Kotlin, PHP, Ruby, Rust, Scala, Swift, Meta and Nim.