A Singly Linked List is a one-direction List that uses a pointer to connect between Nodes. To reverse a linked list, you need to re-connect the directions, for example: …
Given a binary tree, you are asked to check whether it is a mirror of itself (i.e, symmetric around its center): https://leetcode.com/problems/symmetric-tree/ For example, this binary tree is symmetric: …
The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the “root.” Besides the root, each house has …
The Matrix Chain Multiplication Problem is the classic example for Dynamic Programming. If there are three matrices: A, B and C. The total number of multiplication for (A*B)*C and …
April 15, 2015
algorithms, BFS, Breadth First Search, c / c++, Depth First Search, DFS, dynamic programming, Dynamic Programming, Memoization, python, Recursion
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each …