Skip to main content

36 docs tagged with "Stack"

View all tags

Binary Search Tree Iterator

Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.

Car Fleet

Return the number of distinct groups of cars (car fleets) that reach the target mile together, where a fleet is formed when a faster car catches up to a slower car and they travel at the slower car's speed.

Implement Queue using Stacks

This document provides an implementation of a queue using stacks, supporting push, pop, peek, and empty operations.

Mini Parser

This is a solution to the Mini Parser problem on LeetCode.

Next Greater Element II

Given a circular integer array nums (i.e., the next element of `nums[nums.length - 1]` is `nums[0]`), return the next greater number for every element in nums..

Number of Atoms

This is a solution to the Number of Atoms problem on LeetCode.

Parenthesis Checker

This tutorial covers the solution to the Parenthesis Checker problem from the GeeksforGeeks website, featuring implementations in Python and C++.

Reorder List

This is a solution to the Reorder List problem on LeetCode.

Simplify Path

This is a solution to the Simplify Path problem on LeetCode.

Stack Designer

This is a solution to the Stack Designer problem on GeeksForGeeks.

Stock Spanner

This is a solution to the Stock Spanner on LeetCode.

Tag Validator

This is a solution to the Tag Validator problem on LeetCode.

Trapping Rain Water(LeetCode)

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.

Valid Parentheses (LeetCode)

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.