AlgoTree
  • Home
  • Algorithms
    • Sorting Algorithms
      • Merge Sort
      • QuickSort
    • Binary Search
      • Searching a number in a 2D Sorted Matrix
      • Binary Search : Counting Duplicates ๐Ÿคก ๐Ÿคก
      • Binary Search : Finding Square Root โˆš
      • Smallest Number In A Rotated Sorted Array
      • Search Number In A Rotated Sorted Array โ†ป
      • Binary Search : Allocate books ๐Ÿ“š
      • Binary Search : Ship packages ๐Ÿšข
    • Range Minimum Queries ( RMQ ) : Sparse Table
    • Binary Indexed Tree ( Fenwick Tree ) ๐Ÿ—‚
    • Adjacency Lists
      • [ C++ ] : Storing Graph As An Adjacency List
      • [ Java ] : Storing Graph As An Adjacency List
      • [ Python ] : Storing Graph As An Adjacency List
    • Tree & Graph Traversals
      • Pre-Order, In-Order & Post-Order Traversals
      • In-Order & Pre-Order : Construct Binary Tree
      • In-Order & Post-Order : Construct Binary Tree
      • Level Order Tree Traversal
      • Right View Of A Binary Tree ๐ŸŒฒ โ†
      • Level Order : Sum Of The Deepest Leaves
      • Top View Of A Binary Tree
      • Balance Binary Search Tree โš–
      • Level Order : Minimum Depth Of A Binary Tree
      • Breadth First Search ( BFS )
        • BFS : Finding Max Area Of An Island
        • BFS : Finding The Number Of Islands ๐Ÿ ๐Ÿ
      • Depth First Search ( DFS )
        • DFS : Finding Longest Path In A Tree
        • DFS : All Paths In A Directed Acyclic Graph
        • DFS : Detecting Cycle In A Directed Graph โžฐ
        • DFS : Detecting Cycle In An Undirected Graph
      • Topological Sort
      • [ C++ ] : Lexical Topological Sort
      • [ Python ] : Lexical Topological Sort
      • Finding A Binary Subtree In A Tree
      • Finding Diameter of a Binary Tree
      • Deleting Leaf Nodes In A Binary Tree
      • Merging Binary Trees
      • Binary Search Tree
        • Searching A Binary Search Tree
        • Validating A Binary Search Tree
        • Inserting Into A Binary Search Tree
      • Height-Balanced Tree Check Using Recursion
      • Height-Balanced Tree Check Using Traversal
    • Heap
      • [ C++ ] : Max & Min Heap ( Priority Queue / Set )
      • [ Python ] : Max & Min Heap ( HeapQ )
      • K Most Frequent Elements In An Array
      • K'th largest and smallest element in an array
      • Merge K Sorted Linked Lists
      • LRU ( Least Recently Used ) Cache
    • Stack
      • Expression Conversion : Infix To Postfix
      • Evaluating An Infix Expression
      • Largest Rectangle In A Histogram ๐Ÿ“Š
      • Max Size 1 Filled Rectangle In A Binary Matrix
      • Stock Span Problem ๐Ÿ“ˆ
      • Longest Valid Parentheses
    • Hash Table & Set
      • LFU ( Least Frequently Used ) Cache
      • Finding Anagrams
      • Grouping Anagrams
      • Longest Substring w/o Repeating Characters
    • Linked List ๐Ÿ”—๐Ÿ”—๐Ÿ”—๐Ÿ”—
      • Singly Linked List : Insert & Append
      • Singly Linked List : Reverse
      • Singly Linked List : Detect Cycle
      • Singly Linked List : Remove Duplicates
      • Doubly Linked List : Insert, Append & Delete
    • Backtracking
      • N Queens problem โ™› โ™› โ™› โ™› โ™› โ™› โ™› โ™›
      • Backtracking + DFS : A Game Of Boggle
      • Letter Phone ๐Ÿ“ฑ
      • Generating Integer Partitions
      • Partition N Elements Into K Non-Empty Subsets
      • Palindrome Partitioning
      • Break a string into a given set of words
    • Greedy
      • Light Bulbs ๐Ÿ’ก ๐Ÿ’ก ๐Ÿ’ก ๐Ÿ’ก ๐Ÿ’ก
    • Disjoint-Set : Union By Rank, Path Compression
    • Lowest Common Ancestor ( LCA )
      • Finding The LCA Using Recursion
      • Finding The LCA Using Upward Traversals
      • Finding The LCA By Moving Level Up And Closer
    • Minimum Spanning Tree Algorithms
      • [ Python ] : Prim's Minimum Spanning Tree
      • [ Java ] : Prim's Minimum Spanning Tree
      • [ C++ ] : Prim's Minimum Spanning Tree
      • Kruskal's Minimum Spanning Tree
    • Single Source Shortest Path Algorithms
      • [ Python ] : Dijkstra's Shortest Path
      • [ C++ ] : Dijkstra's Shortest Path
      • [ Java ] : Dijkstra's Shortest Path
      • Bellman-Ford's Shortest Path Algorithm
      • Bellman Ford's Algorithm For DAG
    • All Pairs Shortest Path : Floyd-Warshall
    • Numeric ๐Ÿ”ข
      • Fibonacci Sequence ๐Ÿงฌ
      • Euler's Totient Function
      • Prime Sieve : Generating Prime Numbers
      • Prime Factors
      • Euclid's : Finding The Greatest Common Divisor
      • Factorials Of Large Numbers !
      • Fast Exponentiation
      • Modular Multiplication & Exponentiation
      • Prime Or Non Prime ( Miller-Rabin )
      • Pythagorean Triples ๐Ÿ“
      • Pythagorean Triples In An Array ๐Ÿ“
      • Binomial Coefficents
      • Subsets / Combinations : Bitwise
      • Subsets Using Permutations
      • Integer To Hexadecimal Conversion
      • Matrix Multiplication
    • Sudoku
      • Validate A Given Sudoku
    • Computational Geometry
      • Line Segment Intersection
    • Bitwise Operations
      • Number Of Set Bits In An Integer
      • Toggle Last Set Bit
      • Swapping Integers Using Bitwise XOR
      • Binary To Decimal Conversion
    • Recursive Algorithms ๐ŸŒ€ ๐ŸŒ€ ๐ŸŒ€
      • Recursive : Finding the N'th Fibonacci number
      • Recursive : Generating Permutations
      • Recursive : Generating Subsets / Combinations
      • Recursive : Dollar sack ๐Ÿ’ฐ๐Ÿ’ฐ๐Ÿ’ฐ
      • Recursive : Generating Subsequences
      • Recursive : Generating All Balanced Parenthesis
      • Recursive: Word Search
      • Recursive : Tower Of Hanoi ๐Ÿ—ผ
      • Recursive : Finding Max Depth Of A Binary Tree
    • Dynamic Programming
      • Longest Common Subsequence ๐Ÿงฌ
      • Longest Increasing Subsequence ๐Ÿงฌ
      • Distinct Subsequences ๐Ÿงฌ
      • Matrix Chain Multiplication โ›“ โŒ โ›“ โŒ โ›“
      • Finding Longest Palindromic Substring
      • Minimum Cuts To Make A Palindrome โœ‚ โœ‚
      • Word Break
      • String Interleave
      • 0-1 Knapsack Problem ๐Ÿ’ฐ
      • Coins Change Problem ๐Ÿช™
      • Minimum Coins For Making Change ๐Ÿ’ต ๐Ÿช™
      • Integer Partitioning Problem
      • Subset Sum Problem โІ
      • Maximum Product Subarray Problem
      • Maximum Sum Subarray Problem
      • Finding Size Of Biggest 1 Filled Square
      • Maximum Sum SubRectangle
        • Using Aggregate Rectangles
        • Applying Kadane's Algorithm On Row Sums
      • Unique Paths In A Grid โ–ฆ
      • Egg Drop Problem ๐Ÿฅš
      • Assignment Problem Using BitMask
      • Edit Distance
      • Climbing Stairs Problem ๐Ÿชœ
    • KMP Pattern Match Algorithm
    • Minimum Steps To Make Two Strings Anagrams
    • Trie [ Python ] [ Java ]
    • Trie [ C++ ]
      • Counting Distinct Substrings
      • Solving Boggle Using Trie & Depth First Search
    • Rubix Cube
      • Solving a 2 x 2 Rubix Cube ๐Ÿ’ 
      • Solving a 3 x 3 Rubix Cube
    • A Pinch Of Code
      • Java : List - Create & Initialize
      • Java : List Of Arrays
      • Python : Create A Dictionary From A List
      • Python : Sort Dictionary By Value & Key
      • Python : Delete Key & Value from Dictionary
      • Python : Merge Dictionaries
      • Python : Two dimensional list.
      • Python : Convert List Of Strings To List Of Int
      • Python : Getting Current Date & Time
      • Python : Decorators
      • Python : Reading JSON file
      • Python : Agrument Parser
      • Python : First & Last N Characters Of A String
      • Go : Check If File Exists
      • Go : Read File Line By Line
      • Go : Extract Pattern Using Regular Expression
      • Go : Check If A Key Exists In A Map ( Dict )
      • Go : Remove / Hide fields from a struct
      • C++ : Compilation Process
      • C++ : String conversion upper / lower case
      • C++ : Convert String Of Integers Into A Vector
      • C++ : Static Keyword
      • C++ : Copy Constructor
      • C++ : Lvaule and Rvalue
      • C++ : Move Constructor
      • C++ : Overload Assignment (=) Operator
      • C++ : Move Assignment Operator
      • C++ : Overload Subscript ( [ ] ) Operator
      • C++ : Member Initializer List
      • C++ : Singleton Design Pattern
      • C++ : Templates
      • C++ : static_cast & dynamic_cast
      • C++ : const_cast & reinterpret_cast
      • C++ : Throwing Exceptions From A Destructor
      • C++ : Lambda Expression & Callback Functions
      • C++ : Smart Pointers ( unique, shared, weak )
      • C++ : Initializing A Vector
      • C++ : Threads ( Producer & Consumer )
      • C++ : Threads & Condition Variable ๐Ÿงต
      • C++ & Boost : Program Options
      • C++ & Boost : Parsing XML
      • C++ & Boost : Generating UUID
      • JavaScript : Remove An Item From An Array
      • JavaScript : Accept Only A Numeric Input
      • JavaScript : Extract Numbers From String
  • About
Algotree > Tags > Queue

tag :: Queue

  • Breadth First Search ( BFS ) Algorithm