Queue using two stacks

A Queue is a FIFO (First In First Out) data structure. In this article, we aim to implement a Queue using two stack data structures. To implement Queue generally, we have some simple data structure that can hold data. In general, Queue supports insertion (enqueue) and deletion (dequeue) operations, which we can do with constantRead More »

Shuffle an integer array

Shuffling is a procedure to randomize the input values by swapping back and forth. In this article, we aim to rearrange the input integer array uniquely. Let’s see an example step by step approach. Step by step approach Firstly, we pick a random index below size-1 (by skipping the last item) and tries to swapRead More »