Tag

Monotonic Stack

0 views collected around this technical thread.

IT Services Circle
IT Services Circle
Nov 21, 2023 · Fundamentals

LeetCode 42 – Trapping Rain Water: Problem Overview and Three O(n) Solution Techniques (Two‑Pointer, Prefix‑Max, Monotonic Stack)

This article explains LeetCode problem 42 “Trapping Rain Water”, detailing the problem statement, example, and three efficient O(n) solution approaches—two‑pointer, prefix‑max arrays, and a monotonic stack—each accompanied by complete Java implementations and analysis of their logic.

AlgorithmJavaLeetCode
0 likes · 7 min read
LeetCode 42 – Trapping Rain Water: Problem Overview and Three O(n) Solution Techniques (Two‑Pointer, Prefix‑Max, Monotonic Stack)
New Oriental Technology
New Oriental Technology
May 20, 2021 · Fundamentals

Understanding Stacks: Concepts, Common Use Cases, and JavaScript Implementations

This article explains the stack data structure, its LIFO characteristics, typical applications such as bracket matching, expression evaluation, next‑greater‑element problems, browser navigation, and JavaScript execution contexts, and provides clear JavaScript code examples for each scenario.

AlgorithmData StructuresJavaScript
0 likes · 12 min read
Understanding Stacks: Concepts, Common Use Cases, and JavaScript Implementations