Today is chef’s friend’s birthday. He wants to give a gift to his friend. So he was desperately searching for some gift here and there.
Fortunately, he found an array a of size n lying
… Read More Fortunately, he found an array a of size n lying
Interview Questions asked in Google, Microsoft, Amazon
by Dhaval Dave
by Dhaval Dave
Ex: Input: 1 2 5 3 6 8 7 Output: 5 6 7 8
As given in Above example we need to find Longest Consecutive sequence in O(n)
I have implemented in O(n) considering by
by Dhaval Dave
Algorithm:
This problem can be easily solved in O(n) time
by Dhaval Dave
by Dhaval Dave
by Dhaval Dave
by Dhaval Dave
by Dhaval Dave
by Dhaval Dave
by Dhaval Dave