std::map

Iterate over a Map in Reverse Order in C++

In this article, we will discuss different ways to iterate over a map in reverse order. Introduction Map store the elements in sorted order of keys. For example, if you store following elements in map i.e. {“aaa”, 10}, {“ddd”, 11}, {“bbb”, 12}, {“ccc”, 13} It will internally store the elements in sorted order of keys

Iterate over a Map in Reverse Order in C++ Read More »

Using STL to verify brackets or parentheses combination in an expression

In this we will see how to check if a given string take valid combination of open and close brackets i.e. (4+{8-[22+8]*}] contains valid order of open and close brackets. ({5+8]) contains invalid combination of open and close brackets. [showads ad=inside_post] Bracket combinations to be used, { , } [,] (,) Algo Used:   Create a empty stack of characters Traverse

Using STL to verify brackets or parentheses combination in an expression Read More »

Scroll to Top