Introduction Let’s imagine a scenario in which we have a rotated sorted array of distinct elements, i.e., sorted in ascending order then rotated around some pivot. Now, we have to search a given element in this rotated sorted array. Let’s ...

Introduction Insertion sort is a sorting algorithm in which the elements are transferred one at a time to their correct position. It can be considered as shifting around and inserting elements in the right order to sort an unsorted array ...

C++ STL has a bunch of algorithms in itself. Sorting, numeric, removal, modifying and non-modifying algorithms are some examples. In the article let’s talk about the famous mutating and non-mutating algorithms in C++. Mutating Algorithms: These algorithms are modifying algorithms ...