Given an array of n distinct integers sorted in ascending order, write a function that returns a Fixed Point in the array such that Arr[i] = i .
If there is any Fixed Point present
… Read More If there is any Fixed Point present
Interview Questions asked in Google, Microsoft, Amazon
by Dhaval Dave
by Dhaval Dave
by Dhaval Dave
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
by Dhaval Dave
This problem
by Dhaval Dave
Algorithm:
This problem can be easily solved in O(n) time
by Dhaval Dave
by Dhaval Dave