klee's algorithm | Length of union of line segments

  Рет қаралды 11,701

Techdose

Techdose

4 жыл бұрын

This video explains a very important geometric algorithm which is asked in interviews frequently which is the klee's algorithm. This algorithm is used to find the longest line which is formed by the given line segments,i.e., finding the longest length of union of segment of lines. I have explained a very specific technique which works in just O(NlogN). As usual, the CODE LINK is given below. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)
CODE LINK: gist.github.com/SuryaPratapK/...

Пікірлер: 27
@harilalmn
@harilalmn 2 жыл бұрын
Nicely explained.. Thanks...
@satyaprakashsingh952
@satyaprakashsingh952 Жыл бұрын
No one can explain like you
@lalityadav7377
@lalityadav7377 4 жыл бұрын
Nice Explanation...Anyway you are great bro...even free...thank you so much!
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :)
@kishanjaiswal1975
@kishanjaiswal1975 4 жыл бұрын
Thanks bro for this type of content/Algorithm's. As I have never came across this type of problems.Thanks mate!!! It will be helpful if you could upload such more Algorithm's as my placements are going to start in the coming months.
@techdose4u
@techdose4u 4 жыл бұрын
My prime goal is to put videos which will help in interviews :)
@kishanjaiswal1975
@kishanjaiswal1975 4 жыл бұрын
Can you also give me some suggestion to improve my coding skills 🙏🙏
@techdose4u
@techdose4u 4 жыл бұрын
Keep practicing and try solving new questions :) keep trying harder.
@yashpreetbathla4653
@yashpreetbathla4653 4 жыл бұрын
Thank you so much sirrr , keep making this kind of important Algorithm 😻❤️
@techdose4u
@techdose4u 4 жыл бұрын
Sure :)
@shan_singh
@shan_singh Жыл бұрын
Thank you klee That was clever
@akhila5597
@akhila5597 3 жыл бұрын
Interesting ! thanks a lot
@techdose4u
@techdose4u 3 жыл бұрын
Welcome :)
@amitavamozumder73
@amitavamozumder73 3 жыл бұрын
we can also just sort with starting value and use a stack right? push if we can join them or check stack top and bot difference and pop them all.
@satyaprakashsingh952
@satyaprakashsingh952 Жыл бұрын
I watch your video everyday
@Tracks777
@Tracks777 4 жыл бұрын
nice content
@techdose4u
@techdose4u 4 жыл бұрын
:)
@abhiarya7893
@abhiarya7893 Жыл бұрын
Can I solve this question using Merge Interval Question which is more easy than this algorithms
@jasmin_bheda
@jasmin_bheda 2 жыл бұрын
thank u brother ♥
@techdose4u
@techdose4u 2 жыл бұрын
Welcome :)
@satyasahoo9573
@satyasahoo9573 4 жыл бұрын
Had we taken the line, 8-12, instead of 9-12, the counter must have also hit zero at 6:20, but there will not be any gap. How can we be so sure that there will be a gap.
@HimanshuSharma-tm2ms
@HimanshuSharma-tm2ms 4 жыл бұрын
it won;t hit zero as (8,f) will come before (8,t) so counter will increase and will become zero at 12 only
@pleasesirmorevideos4684
@pleasesirmorevideos4684 3 жыл бұрын
is there any place where i can submit solution for this problem. i want to check m solution. anyone?
@anupamkgupta2932
@anupamkgupta2932 3 жыл бұрын
I also want to submit this problem solution
@mromega8945
@mromega8945 Жыл бұрын
This is Victor Klee's algorithm?
@mwshubham
@mwshubham 2 жыл бұрын
I didn't find this algo much exciting as one can simply sort the array using in place algo and run a loop to calculate it.
@mwshubham
@mwshubham 2 жыл бұрын
Thanks for the wonderful explanation as always.
Check if a point lies inside a triangle
3:45
Techdose
Рет қаралды 23 М.
Sieve of eratosthenes
9:50
Techdose
Рет қаралды 56 М.
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 7 МЛН
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 60 МЛН
11   2   Line Segment Intersection 546
5:47
Osiris Salazar
Рет қаралды 37 М.
SHA: Secure Hashing Algorithm - Computerphile
10:21
Computerphile
Рет қаралды 1,2 МЛН
Painter partition problem | Dynamic programming
22:44
Techdose
Рет қаралды 30 М.
Largest number formed from an array
8:33
Techdose
Рет қаралды 117 М.
Circular tour problem
9:26
Techdose
Рет қаралды 58 М.
Line Segment Intersection
5:55
EngineerNick
Рет қаралды 13 М.
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 7 МЛН