Stacks Maximum Element MaximumElement.java Tutorial Stacks Balanced Brackets BalancedBrackets.java Stacks Equal Stacks EqualStacks.java Tutorial Stacks Largest Rectangle LargestRectangle.java Stacks Simple Text Editor SimpleTextEditor.java Trees Preorder Traversal PreorderTraversal.java Trees Inorder Trave...
Stacks Maximum Element 20 Solution.java Stacks Balanced Brackets 25 Solution.java Trees Tree: Preorder Traversal 10 Solution.java Trees Tree: Inorder Traversal 10 Solution.java Trees Tree: Postorder Traversal 10 Solution.java Trees Tree: Height of a Binary Tree 10 Solution.java Trees Tree: Level...
Stacks Maximum Element 20 Solution.java Stacks Balanced Brackets 25 Solution.java Trees Tree: Preorder Traversal 10 Solution.java Trees Tree: Inorder Traversal 10 Solution.java Trees Tree: Postorder Traversal 10 Solution.java Trees Tree: Height of a Binary Tree 10 Solution.java Trees Tree: Level...
Maximum Element C++ Push-O(1), Delete - O(n), Print - O(1) Push - O(1), Delete - O(1), Print - O(1) Easy 20 Balanced Brackets Java O(n) O(n) Medium 25 Queues#TitleSolutionTimeSpaceDifficultyPointsNote Queue using Two Stacks C# Enqueue - O(1), Dequeue - O(n), Pr...
Maximum Element C++ Push-O(1), Delete - O(n), Print - O(1) Push - O(1), Delete - O(1), Print - O(1) Easy 20 Balanced Brackets Java O(n) O(n) Medium 25 Queues#TitleSolutionTimeSpaceDifficultyPointsNote Queue using Two Stacks C# Enqueue - O(1), Dequeue - O(n), Pr...
Maximum Element C++ Push-O(1), Delete - O(n), Print - O(1) Push - O(1), Delete - O(1), Print - O(1) Easy 20 Balanced Brackets Java O(n) O(n) Medium 25 Queues#TitleSolutionTimeSpaceDifficultyPointsNote Queue using Two Stacks C# Enqueue - O(1), Dequeue - O(n), Pr...
In my opinion I have to find all such paris (i,j) for which a(i) * (aj) <= maximum element in the range of i to j. And i 0| ParentPermalink RobertsN 7 years ago Sorry. I'll run through the code and have a look... ...
Element Present in BST Tree 在BST里找元素 题目 看一个BST里有没有值为val的元素,有返回1,没有返回0。 用cur去遍历,用pre存储cur在本次循环起始的位置,谁知道cur.left和cur.right存在不存在呢,对吧。 Solution private static int isPresent(Node root, int val){ ...
"Next greater element", "Next lesser element"Monotonic stack "Longest subsequence", "Smallest subsequence", "Maximum", "Minimum", "Neighbors"Sliding window "Subsequence in a graph"Memoization,Backtracking (DFS) "In-place"Swap "Loop/cycle in a linked list"Slow and Fast pointers i.e. Hare and...
Maximum Element C++ Push-O(1), Delete - O(n), Print - O(1) Push - O(1), Delete - O(1), Print - O(1) Easy 20 Balanced Brackets Java O(n) O(n) Medium 25 Queues#TitleSolutionTimeSpaceDifficultyPointsNote Queue using Two Stacks C# Enqueue - O(1), Dequeue - O(n), Pr...