Data Structures Merkle Tree [Explained] Merkle tree is named after Ralph Merkle, it is a tree data structure where non-leaf nodes are a hash of its child nodes and leaf nodes are a hash of a block of data. This is an USPTO patented Algorithm.
Data Structures Cuckoo filter [Explained] A cuckoo filter is a probabilistic data structure that is used to test whether an element is a member of a set or not. It is similar to the Bloom filter.
List of Mathematical Algorithms Equilibrium Index: Find index such that sum of left sub-array = right sub-array For a given array, we need to find an index such that sum of left sub-array = right sub-array also called the Equilibrium Index. We solve this using brute force approach O(N^2) and using prefix array in linear O(N) time.
Algorithms Finding LCM of an array of numbers Find the LCM of the given array of positive numbers. We have explored 2 approaches: one using GCD and other without using GCD.
Algorithms Implementing two stacks in one array We will demonstrate how to implement 2 stacks in one array. Both stacks are independent but use the same array. We need to make sure one stack does not interfere with the other stack and support push and pop operation accordingly.
Algorithms Column Sort Algorithm Column Sort Algorithm is a non-traditional sorting algorithm for Distributed Memory Clusters (DMC) (means multiple processors). It is a generalization of odd-even merge sort and is used in a parralel system where multiple CPUs are available for use.
Algorithms Move the first element of the linked list to the end In this problem, given a linked list, we move the first element of the linked list to the end of the linked list.
Algorithms Convert one string to another by changing all occurrence of a character to another We will be solving Check if one string can be converted to another by changing all occurrence of a character to another character problem using the Union and Find algorithm.
Algorithms Maximum XOR of two numbers in an array using Trie Given a list of numbers we need to identify a pair of numbers in the list such that the XOR of those numbers is the maximum possible over all the pairs.
Algorithms Find k-th smallest element using QuickSelect algorithm Quickselect is an approach where we use divide and conquer and find the k th smallest element in an average O(N) time.
Algorithms Longest Alternating Subsequence Given an array, find the length of the longest alternating subsequence. We solve this using two approaches: Dynamic Programming and Efficient Approach.
Data Structures Applications of Binary Tree Binary Tree is the most used Tree Data Structure and is used in real life Software systems. We have listed applications of Binary Tree and its variants.
Algorithms Basics of stable matching We have covered the basics of Stable Matching and algorithms associated with it like Gale Shapley Algorithm, Irving's Algorithm, Hospital Residents Problems and more.
Algorithms Maximal Rectangle problem (using Monotonic queue) We have solved the maximal rectangle problem using Monotonic queue. In this problem we are given a matrix consisting of only 0's and 1's, we need to find the largest rectangle consisting of only 1's and return its area.
Algorithms Monotonic Queue (with Daily Temperatures & Largest Rectangle in Histogram) Monotonic queue is a data structure where the data is entirely in non-decreasing order or entirely in non-increasing order. It is generally used for optimizing dynamic programming techniques.
Algorithms Reverse a Stack The objective of this article is to explore various approaches that can be used to reverse the given stack (stack is a linear data structure where insertion and deletion are made at the same end).
Algorithms Zig Zag Traversal of Binary Tree In this article, we present 4 different approaches for Zig Zag Traversal of Binary Tree using stack, deque, recursion and an iterative approach.
Algorithms Check if 2 Binary Trees are isomorphic Two Binary Trees are known as isomorphic if one of them can be obtained from the other one by series of flipping of nodes, swapping the children both left and right of number of nodes.
Algorithms Convert Binary Tree to Circular Doubly Linked list To convert binary tree to circular doubly linked list, we will take left node as previous pointer and right node as next pointer. The order of nodes in Doubly Linked List must be same as in inorder of the given binary tree.
Algorithms Succinct (0-1) Encoding of Binary Tree Succinct (0-1) Encoding of Binary Tree is an approach to encode a Binary Tree to the lowest possible space and maintain the structural information.
Algorithms LCA in Binary Tree using Euler tour and Range Minimum Query In this problem, we will find the Lowest Common Ancestor of a Binary Tree using Euler tour and Range Minimum Query. We can solve the LCA problem by reducing it to a RMQ problem.
Algorithms Lowest Common Ancestor in a Binary Tree In binary trees, for given two nodes a and b, the lowest common ancestor is the node of which both a and b are descendants. We explored the algorithm to find Lowest Common Ancestor in a Binary Tree.
Problems on Binary Tree Operations in Threaded Binary Tree There are three main operations which can be done on a threaded binary tree Insert, Search and Delete operation which we have explained in depth.
Problems on Binary Tree Threaded Binary Tree Threaded binary tree is a simple binary tree but they have a speciality that null pointers of leaf node of the binary tree is set to inorder predecessor or inorder successor.
Algorithms Boolean Parenthesization Problem We will solve Boolean Parenthesization Problem using Dynamic Programming and understand the algorithm with a step by step explanation. The time complexity to solve this problem is O(N^3) with a space complexity of O(N^2).