A common question from interviewers, in this tutorial we will take a look at how to implement a queue data structure by using the stack data structure. There are a couple of things that we need to understand about these data structures in order to come to a plausible solution.
In this post, I want to talk about how to find a duplicate in a character array. Although the example is about an character array, this could easily be implemented to any type of value typed array in Java. Let's say that we are given an array of characters, and we want to know if this array has any duplicates in it.