of first non repeating character
What is time and space complexity of this code
@kishoretaru, if n is the number of characters in the stream
then the time complexity is o(n) as notice that for every character we insert it only once in the queue and pop it once, so for n characters we push and pop n times i.e 2n operation thus o(n) complexity and the space complexity is o(characters in the alphabet) approx o(1), as the freq array takes 26 size and the queue size also never exceed 26
In case of any doubt feel free to ask 
Mark your doubt as RESOLVED if you got the answer
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.