Algo-ds Important Qns

10
Compiled By Sreenivasan AC BINARY SEARCH Binary Search Example Search an element in a sorted and pivoted array Check for Majority element in a Sorted array Floor and Ceiling in a sorted array Find the Minimum length Unsorted Subarray, sorting which makes the array sorted Count the number of occurrences of x in a sorted array Find a Fixed Point ( where a[i] equals i ) in a given array Find the maximum element in an array which is first increasing and then decreasing Merge two sorted arrays of size N and M Median of two sorted arrays Longest Increasing Subsequence in O(NlogN) Find the minimum element/(or search for an element) in a sorted and rotated array Given an array of infinite size containing 0/1 only and in sorted order, find position of first 1 DIVIDE AND CONQUER Introduction Calculate pow(X,N) in O(logN) Find the N-th Fibonacci Numberin O(logN) Closest Pair of Points - O(NlogN) Closest Pair of Points - O(nlogn) Implementation Maximum Subarray Sum in O(NlogN) BIT MANIPULATIONS Check if a given number is a power of 2 Reverse bits of a number Count set bits in an integer Count numer of set its to be flipped to convert A to B Rotate bits of an integer Compute the absolute value (abs) without branching Turn off the rightmost set bit Add two numbers without using arithmetic operators Position of the right most set bit Swap every consecutive odd and even positioned bit in a number Find the position of the only set bit Perform nibble wise swap in a byte of data

description

important algo questions

Transcript of Algo-ds Important Qns

  • Compiled By Sreenivasan AC

    BINARY SEARCH Binary Search Example Search an element in a sorted and pivoted array Check for Majority element in a Sorted array Floor and Ceiling in a sorted array Find the Minimum length Unsorted Subarray, sorting which makes the array sorted Count the number of occurrences of x in a sorted array Find a Fixed Point ( where a[i] equals i ) in a given array Find the maximum element in an array which is first increasing and then decreasing Merge two sorted arrays of size N and M Median of two sorted arrays Longest Increasing Subsequence in O(NlogN) Find the minimum element/(or search for an element) in a sorted and rotated array Given an array of infinite size containing 0/1 only and in sorted order, find position of first 1

    DIVIDE AND CONQUER Introduction Calculate pow(X,N) in O(logN) Find the N-th Fibonacci Numberin O(logN) Closest Pair of Points - O(NlogN) Closest Pair of Points - O(nlogn) Implementation Maximum Subarray Sum in O(NlogN)

    BIT MANIPULATIONS Check if a given number is a power of 2 Reverse bits of a number Count set bits in an integer Count numer of set its to be flipped to convert A to B Rotate bits of an integer Compute the absolute value (abs) without branching Turn off the rightmost set bit Add two numbers without using arithmetic operators Position of the right most set bit Swap every consecutive odd and even positioned bit in a number Find the position of the only set bit Perform nibble wise swap in a byte of data

    http://www.geeksforgeeks.org/the-ubiquitous-binary-search-set-1/http://www.geeksforgeeks.org/search-an-element-in-a-sorted-and-pivoted-array/http://www.geeksforgeeks.org/check-for-majority-element-in-a-sorted-array/http://www.geeksforgeeks.org/search-floor-and-ceil-in-a-sorted-array/http://www.geeksforgeeks.org/minimum-length-unsorted-subarray-sorting-which-makes-the-complete-array-sorted/http://www.geeksforgeeks.org/count-number-of-occurrences-in-a-sorted-array/http://www.geeksforgeeks.org/find-a-fixed-point-in-a-given-array/http://www.geeksforgeeks.org/find-the-maximum-element-in-an-array-which-is-first-increasing-and-then-decreasing/http://www.geeksforgeeks.org/merge-one-array-of-size-n-into-another-one-of-size-mn/http://www.geeksforgeeks.org/median-of-two-sorted-arrays/http://www.geeksforgeeks.org/longest-monotonically-increasing-subsequence-size-n-log-n/http://www.geeksforgeeks.org/find-minimum-element-in-a-sorted-and-rotated-array/http://www.careercup.com/question?id=9691840http://www.geeksforgeeks.org/divide-and-conquer-set-1-find-closest-pair-of-points/http://www.geeksforgeeks.org/write-a-c-program-to-calculate-powxn/http://www.geeksforgeeks.org/program-for-nth-fibonacci-number/http://www.geeksforgeeks.org/closest-pair-of-points/http://www.geeksforgeeks.org/closest-pair-of-points-onlogn-implementation/http://www.geeksforgeeks.org/divide-and-conquer-maximum-sum-subarray/http://www.geeksforgeeks.org/write-one-line-c-function-to-find-whether-a-no-is-power-of-two/http://www.geeksforgeeks.org/write-an-efficient-c-program-to-reverse-bits-of-a-number/http://www.geeksforgeeks.org/count-set-bits-in-an-integer/http://www.geeksforgeeks.org/count-number-of-bits-to-be-flipped-to-convert-a-to-b/http://www.geeksforgeeks.org/rotate-bits-of-an-integer/http://www.geeksforgeeks.org/compute-the-integer-absolute-value-abs-without-branching/http://www.geeksforgeeks.org/turn-off-the-rightmost-set-bit/http://www.geeksforgeeks.org/add-two-numbers-without-using-arithmetic-operators/http://www.geeksforgeeks.org/position-of-rightmost-set-bit/http://www.geeksforgeeks.org/swap-all-odd-and-even-bits/http://www.geeksforgeeks.org/find-position-of-the-only-set-bit/http://stackoverflow.com/questions/8484188/how-to-swap-nybbles-in-cElcotHighlightElcotHighlight
  • Compiled By Sreenivasan AC

    SORTING Stability Lower bound for comparison based sorting algorithms External Sorting

    DYNAMIC PROGRAMMING Overlapping Subproblems Property Optimal Substructure Property

    0-1 Knapsack Problem Min Cost Path Minimum number of jumps to reach end Maximum size square sub matrix with all 1s Matrix Chain Multiplication Coin Change Longest Common Substring Longest Increasing Subsequence Maximum Sum Increasing Subsequence Box Stacking Problem Rod Cutting Minimum insertions to form a palindrome Longest Palindromic Substring Longest Palindromic Subsequence Palindrome Partitioning Dice Throw Maximum sum rectangle in a 2D matrix Largest Independent Set Problem Egg Dropping Puzzle Optimal BST Find if a string is interleaved of two other strings Optimimum Strategy to maximise coins to collect from either ends

    http://www.geeksforgeeks.org/stability-in-sorting-algorithms/http://www.geeksforgeeks.org/lower-bound-on-comparison-based-sorting-algorithms/http://en.wikipedia.org/wiki/External_sortinghttp://www.geeksforgeeks.org/dynamic-programming-set-1/http://www.geeksforgeeks.org/dynamic-programming-set-2-optimal-substructure-property/http://www.geeksforgeeks.org/dynamic-programming-set-10-0-1-knapsack-problem/http://www.geeksforgeeks.org/dynamic-programming-set-6-min-cost-path/http://www.geeksforgeeks.org/minimum-number-of-jumps-to-reach-end-of-a-given-array/http://www.geeksforgeeks.org/maximum-size-sub-matrix-with-all-1s-in-a-binary-matrix/http://www.geeksforgeeks.org/dynamic-programming-set-8-matrix-chain-multiplication/http://www.geeksforgeeks.org/dynamic-programming-set-7-coin-change/http://www.geeksforgeeks.org/longest-common-substring/http://www.geeksforgeeks.org/dynamic-programming-set-3-longest-increasing-subsequence/http://www.geeksforgeeks.org/dynamic-programming-set-14-maximum-sum-increasing-subsequence/http://www.geeksforgeeks.org/dynamic-programming-set-21-box-stacking-problem/http://www.geeksforgeeks.org/dynamic-programming-set-13-cutting-a-rod/http://www.geeksforgeeks.org/dynamic-programming-set-28-minimum-insertions-to-form-a-palindrome/http://www.geeksforgeeks.org/longest-palindromic-substring-set-1/http://www.geeksforgeeks.org/dynamic-programming-set-12-longest-palindromic-subsequence/http://www.geeksforgeeks.org/dynamic-programming-set-17-palindrome-partitioning/http://www.geeksforgeeks.org/dice-throw-problem/http://www.geeksforgeeks.org/dynamic-programming-set-27-max-sum-rectangle-in-a-2d-matrix/http://www.geeksforgeeks.org/largest-independent-set-problem/http://www.geeksforgeeks.org/dynamic-programming-set-11-egg-dropping-puzzle/http://www.geeksforgeeks.org/dynamic-programming-set-24-optimal-binary-search-tree/http://www.geeksforgeeks.org/check-whether-a-given-string-is-an-interleaving-of-two-other-given-strings-set-2/
  • Compiled By Sreenivasan AC

    LINKED LIST Nth node from the end of a Linked list Reverse a Linked List Recursive function to print reverse of a Linked List Check if a singly linked list is a Palindrome Delete Linked list Detect loop in a Linked List Detect and remove loop in a Linked List Middle of a Linked list Find the intersection point of two Linked Lists Intersection of two Sorted Linked Lists Union and Intersection of two Linked Lists Delete Alternate Nodes of a Linked List

    Rotate a Linked List by K nodes Reverse a Linked List in groups of given size K Reverse alternate K nodes in a Singly Linked List

    Merge two sorted linked lists Sort a linked list of 0s, 1s and 2s Segregate even and odd nodes in a Linked List Move vowels to end of Linked List maintaining the order Alternating split of a given Singly Linked List Find a triplet from three linked lists with sum equal to a given number

    Add two numbers represented by linked lists Product of two numbers given in Linked List Pairwise swap elements of a given linked list Swap Kth node from beginning with Kth node from end in a Linked List Delete N nodes after M nodes of a linked list

    Swap odd and even nodes in a Linked List Merge a linked list into another linked list at alternate positions Merge Sort for Linked Lists Flattening a Linked List Copy a linked list with next and arbit pointer

    Memory Efficient DLL using XOR Memory Efficient DLL

    http://www.geeksforgeeks.org/nth-node-from-the-end-of-a-linked-list/http://www.geeksforgeeks.org/write-a-function-to-reverse-the-nodes-of-a-linked-list/http://www.geeksforgeeks.org/write-a-recursive-function-to-print-reverse-of-a-linked-list/http://www.geeksforgeeks.org/function-to-check-if-a-singly-linked-list-is-palindrome/http://www.geeksforgeeks.org/write-a-function-to-delete-a-linked-list/http://www.geeksforgeeks.org/write-a-c-function-to-detect-loop-in-a-linked-list/http://www.geeksforgeeks.org/detect-and-remove-loop-in-a-linked-list/http://www.geeksforgeeks.org/write-a-c-function-to-print-the-middle-of-the-linked-list/http://www.geeksforgeeks.org/write-a-function-to-get-the-intersection-point-of-two-linked-lists/http://www.geeksforgeeks.org/intersection-of-two-sorted-linked-lists/http://www.geeksforgeeks.org/union-and-intersection-of-two-linked-lists/http://www.geeksforgeeks.org/delete-alternate-nodes-of-a-linked-list/http://www.geeksforgeeks.org/rotate-a-linked-list/http://www.geeksforgeeks.org/reverse-a-list-in-groups-of-given-size/http://www.geeksforgeeks.org/reverse-alternate-k-nodes-in-a-singly-linked-list/http://www.geeksforgeeks.org/merge-two-sorted-linked-lists/http://www.geeksforgeeks.org/sort-a-linked-list-of-0s-1s-or-2s/http://www.geeksforgeeks.org/segregate-even-and-odd-elements-in-a-linked-list/http://www.geeksforgeeks.org/alternating-split-of-a-given-singly-linked-list/http://www.geeksforgeeks.org/find-a-triplet-from-three-linked-lists-with-sum-equal-to-a-given-number/http://www.geeksforgeeks.org/sum-of-two-linked-lists/http://www.geeksforgeeks.org/pairwise-swap-elements-of-a-given-linked-list/http://www.geeksforgeeks.org/swap-kth-node-from-beginning-with-kth-node-from-end-in-a-linked-list/http://www.geeksforgeeks.org/delete-n-nodes-after-m-nodes-of-a-linked-list/http://www.geeksforgeeks.org/merge-a-linked-list-into-another-linked-list-at-alternate-positions/http://www.geeksforgeeks.org/merge-sort-for-linked-list/http://www.geeksforgeeks.org/flattening-a-linked-list/http://www.geeksforgeeks.org/a-linked-list-with-next-and-arbit-pointer/http://www.geeksforgeeks.org/xor-linked-list-a-memory-efficient-doubly-linked-list-set-1/http://www.geeksforgeeks.org/xor-linked-list-a-memory-efficient-doubly-linked-list-set-2/
  • Compiled By Sreenivasan AC

    TREES Size of a Tree Height of a Tree Diameter of a Binary Tree Maximum width of a binary tree Check if Two Trees are Identical Tree Traversal

    Populate Inorder Successor for all nodes Level Order Traversal Connect nodes at same level Level Order Traversal in Spiral Form Reverse Level Order Traversal Vertical Sum in a given Binary Tree Difference between sums of odd level and even level nodes of a Binary Tree Check if all leaves are in same level or not Delete a tree Zig-Zag Traversal of Tree Boundary Traversal of binary tree Count leaf nodes in a binary tree Lowest Common Ancestor in a BINARY Tree Print nodes at distance K from root Print Left View of a Binary Tree In a binary tree, if parent is 0, then left child is 0 and right child is 1. if parent is 1, then left child is 1 and right child is 0. Root of the tree is 0. Find the kth node value which is present at Nth level Convert the given Binary tree to its Double tree

    Find the node with minimum value in a BST Add all greater values to every node in a given BST Inorder Successor in BST Lowest Common Ancestor in a BST Check if two trees are Isomorphic

    Check if a given binary tree is SumTree or not Check if given Binary Tree is BST or not Check if Binary Tree is Balanced or not Check if given BT is Complete Binary Tree or not Check if given Binary Tree can be Folded or not Convert Tree to its Mirror Tree Convert a given tree to its Sum Tree Check for children sum property Convert a BT to a tree that holds children sum property

    http://www.geeksforgeeks.org/write-a-c-program-to-calculate-size-of-a-tree/http://www.geeksforgeeks.org/write-a-c-program-to-find-the-maximum-depth-or-height-of-a-tree/http://www.geeksforgeeks.org/diameter-of-a-binary-tree/http://www.geeksforgeeks.org/maximum-width-of-a-binary-tree/http://www.geeksforgeeks.org/write-c-code-to-determine-if-two-trees-are-identical/http://www.geeksforgeeks.org/618/http://www.geeksforgeeks.org/populate-inorder-successor-for-all-nodes/http://www.geeksforgeeks.org/level-order-tree-traversal/http://www.geeksforgeeks.org/connect-nodes-at-same-level-with-o1-extra-space/http://www.geeksforgeeks.org/level-order-traversal-in-spiral-form/http://www.geeksforgeeks.org/reverse-level-order-traversal/http://www.geeksforgeeks.org/vertical-sum-in-a-given-binary-tree/http://www.geeksforgeeks.org/difference-between-sums-of-odd-and-even-levels/http://www.geeksforgeeks.org/write-a-c-program-to-delete-a-tree/http://www.geeksforgeeks.org/boundary-traversal-of-binary-tree/http://www.geeksforgeeks.org/write-a-c-program-to-get-count-of-leaf-nodes-in-a-binary-tree/http://www.geeksforgeeks.org/print-nodes-at-k-distance-from-root/http://www.geeksforgeeks.org/print-left-view-binary-tree/http://www.geeksforgeeks.org/double-tree/http://www.geeksforgeeks.org/find-the-minimum-element-in-a-binary-search-tree/http://www.geeksforgeeks.org/add-greater-values-every-node-given-bst/http://www.geeksforgeeks.org/inorder-successor-in-binary-search-tree/http://www.geeksforgeeks.org/lowest-common-ancestor-in-a-binary-search-tree/http://www.geeksforgeeks.org/check-if-a-given-binary-tree-is-sumtree/http://www.geeksforgeeks.org/a-program-to-check-if-a-binary-tree-is-bst-or-not/http://www.geeksforgeeks.org/how-to-determine-if-a-binary-tree-is-balanced/http://www.geeksforgeeks.org/check-if-a-given-binary-tree-is-complete-tree-or-not/http://www.geeksforgeeks.org/foldable-binary-trees/http://www.geeksforgeeks.org/write-an-efficient-c-function-to-convert-a-tree-into-its-mirror-tree/http://www.geeksforgeeks.org/convert-a-given-tree-to-sum-tree/http://www.geeksforgeeks.org/check-for-children-sum-property-in-a-binary-tree/http://www.geeksforgeeks.org/convert-an-arbitrary-binary-tree-to-a-tree-that-holds-children-sum-property/
  • Compiled By Sreenivasan AC

    Convert a BST to a Binary Tree such that sum of all greater keys is added to every key Find k-th smallest element in BST Find pair of numbers in a BST adding upto K

    Two nodes of a BST are swapped, correct the BST Print BST keys in the given range Remove BST keys outside the given range Remove all nodes in a BST which lie on a path having sum less than k

    Print all root-to-leaf Paths Root to leaf path sum equal to a given number Find the maximum sum leaf to root path in a Binary Tree Print Ancestors of a given node Print ancestors of a given binary tree node without recursion

    BST to DLL Sorted DLL to Balanced BST Sorted Array to Balanced BST Sorted Linked List to Balanced BST Merge Two Balanced Binary Search Trees

    Serialisation - storing a BT in a file Construct Tree from given Inorder and Preorder traversals Construct Special Binary Tree from given Inorder traversal Construct a special tree from given preorder traversal Construct Full Binary Tree from given preorder and postorder traversals Construct Tree from Ancestor Matrix Construct Ancestor Matrix from Tree

    Find the largest BST subtree in a given Binary Tree if entire subtree has to be taken Find the largest BST subtree in a given Binary Tree if part of subtree can also be taken Find the maximum weight node in a tree if each node is the sum of the weights all the nodes under it. Tree nodes can have negative weights.

    Morris Inorder Traversal - Threaded binary Trees Ternary Search Tree

    TRIE

    http://www.geeksforgeeks.org/convert-bst-to-a-binary-tree/http://www.geeksforgeeks.org/find-k-th-smallest-element-in-bst-order-statistics-in-bst/http://www.geeksforgeeks.org/fix-two-swapped-nodes-of-bst/http://www.geeksforgeeks.org/print-bst-keys-in-the-given-range/http://www.geeksforgeeks.org/remove-bst-keys-outside-the-given-range/http://www.geeksforgeeks.org/remove-all-nodes-which-lie-on-a-path-having-sum-less-than-k/http://www.geeksforgeeks.org/given-a-binary-tree-print-all-root-to-leaf-paths/http://www.geeksforgeeks.org/root-to-leaf-path-sum-equal-to-a-given-number/http://www.geeksforgeeks.org/find-the-maximum-sum-path-in-a-binary-tree/http://www.geeksforgeeks.org/print-ancestors-of-a-given-node-in-binary-tree/http://www.geeksforgeeks.org/print-ancestors-of-a-given-binary-tree-node-without-recursion/http://www.geeksforgeeks.org/in-place-convert-a-given-binary-tree-to-doubly-linked-list/http://www.geeksforgeeks.org/in-place-conversion-of-sorted-dll-to-balanced-bst/http://www.geeksforgeeks.org/sorted-array-to-balanced-bst/http://www.geeksforgeeks.org/sorted-linked-list-to-balanced-bst/http://www.geeksforgeeks.org/merge-two-balanced-binary-search-trees/http://www.geeksforgeeks.org/construct-tree-from-given-inorder-and-preorder-traversal/http://www.geeksforgeeks.org/construct-binary-tree-from-inorder-traversal/http://www.geeksforgeeks.org/construct-a-special-tree-from-given-preorder-traversal/http://www.geeksforgeeks.org/full-and-complete-binary-tree-from-given-preorder-and-postorder-traversals/http://www.geeksforgeeks.org/find-the-largest-subtree-in-a-tree-that-is-also-a-bst/http://www.geeksforgeeks.org/inorder-tree-traversal-without-recursion-and-without-stack/http://www.geeksforgeeks.org/ternary-search-tree/http://www.geeksforgeeks.org/trie-insert-and-search/
  • Compiled By Sreenivasan AC

    STACKS & QUEUES Implement two stacks in one array Implement Stack using Queues Implement Queue using Two Stacks Implement stack with push(), pop(), getMin() [ each in O(1) time ] Design a stack with operations on middle element Check for balanced parentheses in an expression Expression Evaluation with operator priority and multiple braces Implement LRU Cache The Stock Span Problem Print the First Greater Element on the right side for each element Largest Rectangular Area in a Histogram Implement three stacks in one array Find maximum element in every window of size K in an array

    STRINGS Print reverse of a string using recursion Print all permutations of a string Given a string find its first non-repeating character Reverse words in a given string Print all the duplicates in the input string Move all even-index positioned chars to end of string maintaining even-odd order

    Find Lexicographic rank of a string Run Length Encoding Implement atoi function Print the first unique character in a string Write strcmp function and returns -1 if s1 < s2, 0 if s1 = s2, else returns 1 Remove from string s1, all the characters that are present in string s2. Check whether two strings are anagram of each other

    Length of the longest substring without repeating characters Find the smallest window in a string containing all characters of another string

    Recursively remove all adjacent duplicates Evaluate a regular expression a*b?c with aaaabcc String Matching - KMP Algorithm

    http://www.geeksforgeeks.org/implement-two-stacks-in-an-array/http://www.geeksforgeeks.org/implement-stack-using-queue/http://www.geeksforgeeks.org/queue-using-stacks/http://www.geeksforgeeks.org/maximum-of-all-subarrays-of-size-k/http://www.geeksforgeeks.org/design-a-stack-with-find-middle-operation/http://www.geeksforgeeks.org/check-for-balanced-parentheses-in-an-expression/http://www.geeksforgeeks.org/expression-evaluation/http://www.geeksforgeeks.org/implement-lru-cache/http://www.geeksforgeeks.org/the-stock-span-problem/http://www.geeksforgeeks.org/next-greater-element/http://www.geeksforgeeks.org/largest-rectangle-under-histogram/http://stackoverflow.com/questions/4770627/how-to-implement-3-stacks-with-one-arrayhttp://www.geeksforgeeks.org/maximum-of-all-subarrays-of-size-k/http://www.geeksforgeeks.org/reverse-a-string-using-recursion/http://www.geeksforgeeks.org/write-a-c-program-to-print-all-permutations-of-a-given-string/http://www.geeksforgeeks.org/given-a-string-find-its-first-non-repeating-character/http://www.geeksforgeeks.org/reverse-words-in-a-given-string/http://www.geeksforgeeks.org/print-all-the-duplicates-in-the-input-string/http://www.geeksforgeeks.org/an-in-place-algorithm-for-string-transformation/http://www.geeksforgeeks.org/lexicographic-rank-of-a-string/http://www.geeksforgeeks.org/run-length-encoding/http://www.geeksforgeeks.org/write-your-own-atoi/http://www.geeksforgeeks.org/given-a-string-find-its-first-non-repeating-character/http://www.geeksforgeeks.org/write-your-own-strcmp-which-ignores-cases/http://www.geeksforgeeks.org/remove-characters-from-the-first-string-which-are-present-in-the-second-string/http://www.geeksforgeeks.org/check-whether-two-strings-are-anagram-of-each-other/http://www.geeksforgeeks.org/length-of-the-longest-substring-without-repeating-characters/http://www.geeksforgeeks.org/find-the-smallest-window-in-a-string-containing-all-characters-of-another-string/http://www.geeksforgeeks.org/recursively-remove-adjacent-duplicates-given-string/https://gist.github.com/bluesunxu/4325359http://www.geeksforgeeks.org/searching-for-patterns-set-2-kmp-algorithm/ElcotHighlight
  • Compiled By Sreenivasan AC

    ARRAYS Find Union and Intersection of two sorted arrays Find the Number Occurring Odd Number of Times Find missing number from array of N-1 numbers in the range 1 to N

    Find the two non-repeating elements in an array of repeating elements Find the two numbers with odd occurrences in an unsorted array Find the next smallest palindrome find the next higher permutation of the given number as an array of digits. If such a number doesnt exist, return -1.

    Find pair of numbers with given sum X Find a,b,c such that a^2+b^2=c^2 Find a triplet that sum to a given value Find four elements that sum to a given value Find two repeating elements in a given array Find the 3 elements such that a[i] < a[j] < a[k] and i < j < k Find the least positive number missing in an unsorted array. Find the row with maximum number of 1s in a 2D row-wise sorted matrix Find Maximum difference between two elements such that the larger element appears after the smaller element in array Find two numbers such that their difference is minimum Find two elements whose sum is closest to zero Find the first subarray which has a zero sum in an array Find duplicates in O(n) time Find points in an array where left-sum==right-sum Search a number in a row wise and column wise sorted 2D matrix Print matrix spirally Measure amount of water in jth glass of ith row of glasses arranged like a pyramid Construct Product Array without division operator: each element = product of elements in arr[] except arr[i] Shuffle a given array Sort elements by frequency

    Segregate Even and Odd numbers Segregate 0s and 1s Sort an array of 0s, 1s and 2s Move all zeroes to end of array Rearrange positive and negative numbers alternatively Given an array [a1b2c3d4] convert to [abcd1234] Maximum and minimum of an array using minimum number of comparisons

    http://www.geeksforgeeks.org/union-and-intersection-of-two-sorted-arrays-2/http://www.geeksforgeeks.org/find-the-number-occurring-odd-number-of-times/http://www.geeksforgeeks.org/find-the-missing-number/http://www.geeksforgeeks.org/find-two-non-repeating-elements-in-an-array-of-repeating-elements/http://www.geeksforgeeks.org/find-the-two-numbers-with-odd-occurences-in-an-unsorted-array/http://www.geeksforgeeks.org/given-a-number-find-next-smallest-palindrome-larger-than-this-number/http://stackoverflow.com/questions/9368205/given-a-number-find-the-next-higher-number-which-has-the-exact-same-set-of-digihttp://stackoverflow.com/questions/9368205/given-a-number-find-the-next-higher-number-which-has-the-exact-same-set-of-digihttp://www.geeksforgeeks.org/write-a-c-program-that-given-a-set-a-of-n-numbers-and-another-number-x-determines-whether-or-not-there-exist-two-elements-in-s-whose-sum-is-exactly-x/http://www.geeksforgeeks.org/find-a-triplet-that-sum-to-a-given-value/http://www.geeksforgeeks.org/find-four-elements-that-sum-to-a-given-value-set-2/http://www.geeksforgeeks.org/find-the-two-repeating-elements-in-a-given-array/http://www.geeksforgeeks.org/find-a-sorted-subsequence-of-size-3-in-linear-time/http://www.geeksforgeeks.org/find-the-smallest-positive-number-missing-from-an-unsorted-array/http://www.geeksforgeeks.org/find-the-row-with-maximum-number-1s/http://www.geeksforgeeks.org/maximum-difference-between-two-elements/http://www.geeksforgeeks.org/maximum-difference-between-two-elements/http://stackoverflow.com/questions/1669922/is-it-possible-to-find-two-numbers-whose-difference-is-minimum-in-on-timehttp://www.geeksforgeeks.org/two-elements-whose-sum-is-closest-to-zero/http://www.geeksforgeeks.org/find-duplicates-in-on-time-and-constant-extra-space/http://www.geeksforgeeks.org/search-in-row-wise-and-column-wise-sorted-matrix/http://www.geeksforgeeks.org/print-a-given-matrix-in-spiral-form/http://www.geeksforgeeks.org/find-water-in-a-glass/http://www.geeksforgeeks.org/a-product-array-puzzle/http://www.geeksforgeeks.org/a-product-array-puzzle/http://www.geeksforgeeks.org/shuffle-a-given-array/http://www.geeksforgeeks.org/sort-elements-by-frequency/http://www.geeksforgeeks.org/segregate-even-and-odd-numbers/http://www.geeksforgeeks.org/segregate-0s-and-1s-in-an-array-by-traversing-array-once/http://www.geeksforgeeks.org/sort-an-array-of-0s-1s-and-2s/http://www.geeksforgeeks.org/move-zeroes-end-array/http://www.geeksforgeeks.org/rearrange-positive-and-negative-numbers-publish/http://www.geeksforgeeks.org/maximum-and-minimum-in-an-array/ElcotHighlightElcotHighlight
  • Compiled By Sreenivasan AC

    Given binary 2D Matrix, for all cells as 1, set corresponding row and column as 1 Turn an image by 90 degrees Inplace M x N size matrix transpose Intersection of n sets Print Matrix Diagonally

    Rotate an array by d elements Largest Sum Contiguous Subarray Maximum Product Subarray Maximum Length Bitonic Subarray Find continous subarray with given sum Largest subarray with equal number of 0s and 1s Maximum subsequence sum such that no two elements are adjacent Find the majority element (with frequency > N/2) Find the maximum repeating number

    Count the number of Inversions in an array Find kth smallest element Stock Buy Sell to Maximize Profit Print the elements greater than all the elements to its right calculate the area of water collected by rain holded by bar graph/histogram

    Graphs Graph representations Depth First Traversal for a Graph Breadth First Traversal for a Graph Detect Cycle in a Directed Graph Find if there is a path between two vertices in a directed graph Find number of connected components in an undirected graph Bellman Ford Algorithm Floyd Warshall Algorithm Kruskal's MST Dijiktra's Shortest Path Algorithm Union Find Union Find by rank Topological Sorting for DAG Detect cycle in an undirected graph

    Strongly Connected Components Shortest Path in Directed Acyclic Graph Maximum Bipartite Matching

    http://www.geeksforgeeks.org/turn-an-image-by-90-degree/http://www.geeksforgeeks.org/inplace-m-x-n-size-matrix-transpose/http://www.geeksforgeeks.org/intersection-of-n-sets/http://www.geeksforgeeks.org/print-matrix-diagonally/http://www.geeksforgeeks.org/array-rotation/http://www.geeksforgeeks.org/largest-sum-contiguous-subarray/http://www.geeksforgeeks.org/maximum-product-subarray/http://www.geeksforgeeks.org/maximum-length-bitonic-subarray/http://www.geeksforgeeks.org/find-subarray-with-given-sum/http://www.geeksforgeeks.org/largest-subarray-with-equal-number-of-0s-and-1s/http://www.geeksforgeeks.org/maximum-sum-such-that-no-two-elements-are-adjacent/http://www.geeksforgeeks.org/majority-element/http://www.geeksforgeeks.org/find-the-maximum-repeating-number-in-ok-time/http://www.geeksforgeeks.org/counting-inversions/http://www.geeksforgeeks.org/k-largestor-smallest-elements-in-an-array/http://www.geeksforgeeks.org/stock-buy-sell/http://www.geeksforgeeks.org/leaders-in-an-array/http://www.geeksforgeeks.org/graph-and-its-representations/http://www.geeksforgeeks.org/depth-first-traversal-for-a-graph/http://www.geeksforgeeks.org/breadth-first-traversal-for-a-graph/http://www.geeksforgeeks.org/detect-cycle-in-a-graph/http://www.geeksforgeeks.org/find-if-there-is-a-path-between-two-vertices-in-a-given-graph/http://www.geeksforgeeks.org/find-number-of-islands/http://www.geeksforgeeks.org/dynamic-programming-set-23-bellman-ford-algorithm/http://www.geeksforgeeks.org/dynamic-programming-set-16-floyd-warshall-algorithm/http://www.geeksforgeeks.org/greedy-algorithms-set-2-kruskals-minimum-spanning-tree-mst/http://www.geeksforgeeks.org/greedy-algorithms-set-6-dijkstras-shortest-path-algorithm/http://www.geeksforgeeks.org/union-find/http://www.geeksforgeeks.org/union-find-algorithm-set-2-union-by-rank/http://www.geeksforgeeks.org/topological-sorting/http://www.geeksforgeeks.org/detect-cycle-undirected-graph/http://www.geeksforgeeks.org/strongly-connected-components/http://www.geeksforgeeks.org/shortest-path-for-directed-acyclic-graphs/http://www.geeksforgeeks.org/maximum-bipartite-matching/
  • Compiled By Sreenivasan AC

    Check if Bipartite Graph Stable Marriage Problem Longest Path in a Directed Acyclic Graph Find maximum number of edge disjoint paths between two vertices Graph Coloring Travelling Salesman Problem

    COMPUTATIONAL GEOMETRY Check whether a given point lies inside a triangle or not check if two given line segments intersect check if a given point lies inside or outside a polygon Convex Hull | Set 1 (Jarviss Algorithm or Wrapping Given n line segments, find if any two segments intersect

    MATHS Binomial Coefficient nCr Pascal's Triangle in nth row Select a random number from stream, with O(1) space

    MISCELLANEOUS Little and Big Endian Memory Leak Greedy Algorithms | Set 1 (Activity Selection Problem) Print all subsets Make a fair coin from a biased coin Find the first circular tour that visits all petrol pumps

    HEAP Sort a nearly sorted (or K sorted) array

    Find the k most frequent words from a file / running stream of numbers Sort numbers stored on different machines Huffman Coding Program to print last 10 lines of a file Merge k sorted arrays Find a median in running stream of numbers.

    http://www.geeksforgeeks.org/bipartite-graph/http://www.geeksforgeeks.org/stable-marriage-problem/http://www.geeksforgeeks.org/find-longest-path-directed-acyclic-graph/http://www.geeksforgeeks.org/find-edge-disjoint-paths-two-vertices/http://www.geeksforgeeks.org/graph-coloring-set-2-greedy-algorithm/http://www.geeksforgeeks.org/travelling-salesman-problem-set-1/http://www.geeksforgeeks.org/check-whether-a-given-point-lies-inside-a-triangle-or-not/http://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/http://www.geeksforgeeks.org/how-to-check-if-a-given-point-lies-inside-a-polygon/http://www.geeksforgeeks.org/convex-hull-set-1-jarviss-algorithm-or-wrapping/http://www.geeksforgeeks.org/given-a-set-of-line-segments-find-if-any-two-segments-intersect/http://www.geeksforgeeks.org/space-and-time-efficient-binomial-coefficient/http://www.geeksforgeeks.org/pascal-triangle/http://www.geeksforgeeks.org/select-a-random-number-from-stream-with-o1-space/http://www.geeksforgeeks.org/little-and-big-endian-mystery/http://www.geeksforgeeks.org/what-is-memory-leak-how-can-we-avoid/http://www.geeksforgeeks.org/greedy-algorithms-set-1-activity-selection-problem/http://www.geeksforgeeks.org/power-set/http://www.geeksforgeeks.org/print-0-and-1-with-50-probability/http://www.geeksforgeeks.org/find-a-tour-that-visits-all-stations/http://www.geeksforgeeks.org/nearly-sorted-algorithm/http://www.geeksforgeeks.org/find-the-k-most-frequent-words-from-a-file/http://www.geeksforgeeks.org/sort-numbers-stored-on-different-machines/http://www.geeksforgeeks.org/greedy-algorithms-set-3-huffman-coding/http://www.geeksforgeeks.org/print-last-10-lines-of-a-given-file/http://www.geeksforgeeks.org/merge-k-sorted-arrays/http://www.geeksforgeeks.org/median-of-stream-of-integers-running-integers/
  • Compiled By Sreenivasan AC

    C++ OOPS concepts like: Inheritance, Encapsulation, Abstraction, Polymorphism virtual function, friend function function overloading, overriding constuctor, templates exception handling storage classes,type qualifiers, modifiers, macros,inline memory allocation reference, pointers

    *STRICTLY NOT FOR REPRODUCTION