Data-Structures-and-Algorithms icon indicating copy to clipboard operation
Data-Structures-and-Algorithms copied to clipboard

Add monotonic stack demo with correct output order

Open AnishCoder2006 opened this issue 5 months ago • 0 comments

This PR adds two functions demonstrating monotonic decreasing and increasing stacks in C++.

  • Ensures correct output order using forward iteration
  • Dry-run verified with input {3, 4, 5, 6, 7, 4, 5, 3}
  • Useful for understanding stack-based filtering and skyline compression

Ready for review and integration.

AnishCoder2006 avatar Nov 10 '25 14:11 AnishCoder2006