Longest Bitonic Subsequence

preview_player
Показать описание
Find longest bitonic subsequence in given array. Bitonic subsequence first increases then decreases.

Рекомендации по теме
Комментарии
Автор

was looking for such outstanding videos for a long really helpful for guys from non-CSE background

akhilguptavibrantjava
Автор

For this use case: [1, 4, 2, 7, 9, 10], the Longest Bitonic Subsequence is {1, 4, 2}, and its length is 3. However, the current approach incorrectly gives a length of 5, which is wrong.

To fix this, we need to validate both the LIS (Longest Increasing Subsequence) and LDS (Longest Decreasing Subsequence) with the following condition:
if (lisLeftToRight[i] > 1 && lisRightToLeft[i] > 1) {
maxi = Math.max(maxi, (lisLeftToRight[i] + lisRightToLeft[i] - 1));
}

This ensures that only valid bitonic subsequences are considered.

jabedhasan
Автор

Awesome Buddy you made my day. It was a mind opener never thought of doing the question this way

amangoel
Автор

Why does the bitonic sequence start out as 2, 3, 5 and not 2, 4, 5. Am lost

akshay
Автор

Great job with the videos Tushar. However, this video felt a little rushed. It can be made much better by telling what was your rationale in going left to right, and right to left, and if there were any tradeoffs or gains you made by going with this approach, and why you deducted 1 in the end (though it's not too difficult to figure it out). P.S. - Your Dynamic Programming videos are awesome! :)

piyushdubey
Автор

Can you or someone explain what is the intuition behind this idea? (why lis[i]+lds[i] -1 should it give max bitoinc sequence)

rajcodingworld
Автор

Sometimes I am confused whether you are teaching others or refreshing your knowledge. Always keep in mind the people who watch your videos are learners. Otherwise, I love videos.

xavier.antony
Автор

Hi,
Can you please provide the recurrence equation for this problem.

BhawaniSelva
Автор

Nice explanation Tushar, It will be really great, if you also mention the thought process behind your approach, then the viewer can also be productive while approaching this kind of dynamic programming.

asifbilla
Автор

Hello Sir,
Your videos are extremely helpful, and are very good, concise and to the point!
You helped me a lot!
I have a request, if you can create similar videos on Graph Theory, and Graph Problems! :)
Thanks Again!

KUSHUTRIVEDI
Автор

sir, you should also explain the concept, you are just explaining the method

sahilsonkar
Автор

Thanks for the explanation. Can you help me with how to print the actual sequence.

gizmogaurav
Автор

sir can u plz upload video on bitonic merge in 2-d mesh network

archanayadav
Автор

Please explain the logic with the methods. Not able to understand anything about the logic.

ryanryan
Автор

your solution fails for the array : [2 1 3]
for left to right the length of subsequences would be : [1 1 2] and for the right to left, it would again be [1 1 2] so your solution will give the answer to be equal to 3 but actually, the answer is 2.
P.S. Someone correct me if I'm wrong.

uchihaitachi
Автор

rather than filling the matrix you must explain the logic, sick of your solutions.

abhishekbakolia
Автор

Bhai thoda thoda smile kro m mat padhao

tamkinraza
Автор

Program fails for input:
7
15 -5 7 7 6 12 -3
( output: 5 ) but gives output : 4

sreepavankumar
Автор

pls explain bitonic merge in Hindi pls ..

buzzselection