Dutch National Flag Partitioning

Dutch National Flag Partitioning Problem Statement Partitioning is a common process used in other algorithms such a quicksort. In this problem, we are given an Array A and an index i. We have to rearrange A such that , all elements less than A[i] appears first followed by all elements equal to A[i] followed by […]

Chef and Rainbow Array

Chef and Rainbow Array Link to problem here. Chef likes all arrays equally. But he likes some arrays more equally than others. In particular, he loves Rainbow Arrays. An array is Rainbow if it has the following structure: First a1 elements equal 1. Next a2 elements equal 2. Next a3 elements equal 3. Next a4 […]

Vectors

Vectors Just like arrays, vectors use contiguous storage locations for their elements, which means that their elements can also be accessed using offsets on regular pointers to its elements, and just as efficiently as in arrays. But unlike arrays, their size can change dynamically, with their storage being handled automatically by the container. Usage  Store […]

Catch Me On Social !!