42 docs tagged with "Algorithm Design Manual"
View all tagsArrange Negative Then Positive Number
4-20
Balanced Parentheses
Check if a string contains properly nested and balanced parentheses, and false if otherwise.
Binary Search Tree
Breadth First Traversal
Bucket Sort
Maintains bucket of 0..9 or a-z
Color Sort
Assume that we are given n pairs of items as input, where the first item is a
Color Sort Linear Time
Suppose an array A consists of n elements, each of which is red, white, or blue.
Cutouts To Generate String
You are given a search string and a magazine.
Dynamic Grow Shrink Array
Edit Distance
Fast Median
NO need to sort all the items.
Find Number Of Occurrence
Find the range in which [str] occurs in [array].
Find Transition Index
Given unbounded 0s followed by unbounded number of 1s, find the first index of transition.
Flatten BST Into Linked List
Graph
Heap Sort
Identical Binary Tree
Given two binary tree, find if they are identical i.e. same value at the same position & same structure
Insertion Sort
How does insertion sort work?
K Sorted List Merge
Give an O(n log k)-time algorithm that merges k sorted lists with a total of n
K Sum
Given a set S of n integers and an integer T,
Largest Occuring Ordered Pair
Magic Index Search
[4-33] Algorithm to determine whether there exists an i index such as ai = i given array of \{a1, a2, a3 ... an\}
Matrix Multiplication
Middle Node Of Linked List
Given a singly-linked list, find its middle node.
Min Difference Between Subsets
Multiplicative Array
You have an unordered array X of n integers. Find the array M containing
No Initialization Array
Design a data structure that allows one to search, insert, and delete an integer
O1Data Structure
Construct a DS with search, remove and add operations of O(1) in worst case
Partial Sum Using Cumulative Sum
Let A[1..n] be an array of real numbers. Design an algorithm to perform any
Partial Sum Using Fenwick Tree
Let A be an array of n real numbers. Design an algorithm to perform any sequence of the following operations:
Permutation
Prim Min Spanning Tree
Solution//www.programiz.com/dsa/prim-algorithm
Reverse Linked List
link here
Reverse Sentence
Reverse the words in a sentence—i.e., “My name is Chris” becomes “Chris is name My.”
Selection Sort
Identify the smallest element from unsorted portion and put it at the end of the sorted portion
Simple Graph
Smallest Missing Number
[4-34]
Smallest Number In Range
Suppose that we are given a sequence of n values x1, x2, ..., xn and seek to
String Pattern Matching
Find substring match
Two Pair Sum
O(nlogn) algorithm for finding whether there exists a pair of elements, one from S1 and one
Union Find
Union-Find represent each subset as backward trees