3015. Count the Number of Houses at a Certain Distance I | Floyd Warshall

  Рет қаралды 2,223

Aryan Mittal

Aryan Mittal

Күн бұрын

Пікірлер: 11
@yuvanshanmugarajt6362
@yuvanshanmugarajt6362 Жыл бұрын
waiting for part II bro
@satwiktatikonda764
@satwiktatikonda764 Жыл бұрын
Waiting for higher tc version
@deepjyotsinghkapoor1955
@deepjyotsinghkapoor1955 Жыл бұрын
Hi Aryan, I'm inclined towards using Dijkstra's algorithm as it boasts a time complexity of O(V + E Log V). With N nodes, the overall time complexity becomes O(V^2 + VE Log V). Considering the typical scenario where E is close to V, we can simplify it further to O(V^2 * Log V). In contrast, the Floyd-Warshall algorithm has a time complexity of O(V^3). I also considered implementing BFS, where each of the V nodes serves as the root. The time complexity of BFS is O(V + E), and when applied to V nodes as roots, it becomes O(V^2 + EV). Since E is equal to V for this problem, the overall time complexity simplifies to O(V^2). Feel free to correct me if there's any flaw in my understanding. Thanks!
@ashutoshchoubey369
@ashutoshchoubey369 Жыл бұрын
Just a question, can't I use dijkstra's in this question which may have slightly better TC then Floyd. And the most intuitive also is the dijkstra's algo.
@himanshuadhikari9440
@himanshuadhikari9440 Жыл бұрын
Floyd is more intuitive ig
@anubhavfitnessclub
@anubhavfitnessclub Жыл бұрын
can u make a video using some other solution for higher time complexities
@FA513M
@FA513M Жыл бұрын
n=5,x=1,y=5 ans=[10,10,0,0,0] in here why 3=0 we can go from 2 to 5 in which min-distance will be 3. can you help???
@anasmaher4783
@anasmaher4783 Жыл бұрын
minimum distance is 2, remember its undirected, so you can go 2 -> 1 1 -> 5
@craftsworld3237
@craftsworld3237 Жыл бұрын
birader part II
@learningmaths786
@learningmaths786 Жыл бұрын
❤❤❤
@anubhavfitnessclub
@anubhavfitnessclub Жыл бұрын
👍👍👍👍👍👍👍👍👍👍👍👍
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
1462. Course Schedule IV | Topological Sort | Kahn's Algorithm
18:55
one year of studying (it was a mistake)
12:51
Jeffrey Codes
Рет қаралды 256 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 244 М.
The Absolute Best Intro to Monads For Software Engineers
15:12
Studying With Alex
Рет қаралды 681 М.
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН