Hasuer's Studio.

Hasuer's Studio.

it's better to burn out than to fade away

24. Pattern Topological Sort (Graph)
416. Partition Equal Subset Sum Design Gurus Educative.io IntroductionTopological Sort is used to find a linear ordering of elements that have dependencies on each other. For example, if event ‘B’ is dependent on event ‘A’, ‘A’ comes before ‘B’ in topological ordering. This pattern defines an eas...
23. Pattern Trie
Introduction to TrieIntroduction to TrieA Trie, short for retrieval, is a specialized tree-based data structure primarily used for efficient storing, searching, and retrieval of strings over a given alphabet. It excels in scenarios where a large collection of strings needs to be managed and patte...
22. Pattern Backtracking
Introduction to Backtracking PatternBacktrackingBacktracking is an algorithmic technique that uses brute-force approach to solve a problem. Brute-force approach states that for any problem, we should try out all possible solutions and pick up those solutions that satisfy the problem constraints....
21. Pattern 01 Knapsack (Dynamic Programming)
Introduction0/1 Knapsack pattern is based on the famous problem with the same name which is efficiently solved using Dynamic Programming (DP). In this pattern, we will go through a set of problems to develop an understanding of DP. We will always start with a brute-force recursive solution to see...
20. Pattern Greedy Algorithms
Introduction to Greedy AlgorithmUnderstanding Greedy AlgorithmA Greedy algorithm is used to solve problems in which the best choice is made at each step, and it finds a solution in a minimal step. This approach assumes that choosing a local optimum at each stage will lead to the determination of ...
19. Pattern K-way merge
IntroductionThis pattern helps us solve problems that involve a list of sorted arrays. Whenever we are given ‘K’ sorted arrays, we can use a Heap to efficiently perform a sorted traversal of all the elements of all arrays. We can push the smallest (first) element of each sorted array in a Min Hea...
18. Pattern Top 'K' Elements
IntroductionAny problem that asks us to find the top/smallest/frequent ‘K’ elements among a given set falls under this pattern. The best data structure that comes to mind to keep track of ‘K’ elements is Heap). This pattern will make use of the Heap to solve multiple problems dealing with ‘K’ ele...
17. Pattern Bitwise XOR
Introduction再看这篇文章之前可以看一下这个知乎 XOR is a logical bitwise operator that returns 0 (false) if both bits are the same and returns 1 (true) otherwise. In other words, it only returns 1 if exactly one bit is set to 1 out of the two bits in comparison. It is surprising to know the approaches that the XO...
16. Pattern Modified Binary Search
IntroductionAs we know, whenever we are given a sorted Array or LinkedList or Matrix, and we are asked to find a certain element, the best algorithm we can use is the Binary Search. This pattern describes an efficient way to handle all problems involving Binary Search. We will go through a set of...
15. Pattern Subsets
Introduction to Subsets PatternA huge number of coding interview problems involve dealing with Permutations and Combinations of a given set of elements. This pattern describes an efficient Breadth First Search (BFS) approach to handle all these problems. Let’s jump onto our first problem to devel...
avatar
Hasuer
witness me