Graph Theory Complete video series : part 1 (9 july2020 - 1 editorial added)

give me the link of updated submission , I am not very good with python but I will try to figure out the problem

1 Like

you’re welcome man

1 Like

Hey! Can you please solve this problem from codeforces?It is a dp problem and I can’t solve it for the larger constraints

Thanks!

This is where I declared the matrices globally :-
Click Here
And this is where I tried a lot of modifications and declared the matrices locally :-
Click Here
I don’t know if you’ll be able to access the links but in case you can’t then here are the two codes as well :-
Globally
Locally
If you can’t figure out the problem, then it’s fine anyway because a real test most likely won’t have time limit this tight.

I think if you use fast IO , it can pass time limit.

I submitted your solution with global array and it is getting TLE in 3 test cases , in all those 3 test cases N and M are 1000 and 1000.

it’s not like your solution is asymptotically slower , if it was the case then your code would not be able to solve Test Case 7 which also has N and M as 1000 * 1000.

read this for fast IO or google : performance - Fastest stdin/out IO in python 3? - Stack Overflow

as I said again I am not very good with python so it will take a lot of time for me to implement and debug.

try for once

after a small change that I made , now the solution is getting TLE on only 2 test cases (3 previously) : https://ideone.com/HIlpK8

I am sure if you use fast I/O it will pass the time limit

I will try to use even faster I/O. Thanks.

gonna do this after exams, thanks a ton man

you’re welcome

Bro In Your Bridge Finding Algorithm , I think You might be missed some edge cases for disconnected graph ???

For example suppose this is the Question

Now suppose Tc is
1
5 3
0 1 1 2 3 4
3 4

Basically Graph is in the form

0-1-2

3-4

and asked that is 3-4 is bridge then Cp algo code giving WA.
{Our code give 0 but actually ans is 1(yes) }

My Solution {After Learning From Your Video}

PS:-
I have already spend 3+ hours to Get AC in this Question, Please let me know how to correct this code.

Finally,
YOU ARE OUR INSPIRATION, THANK-YOU FOR EVERYTHING WHICH YOU HAVE DONE FOR US!!!.

Thank you for this @waqar_ahmad224, a dumb suggestion/question, are you planning to make these videos available as a playlist on Youtube on the channel? so that one(like me) can watch all of them in one sitting? :stuck_out_tongue: Please suggest.

2 July 2020 : 1 practice Problem Added
E002 : Tree Query | Hackerearth | Graph & Tree

I have playlist.
for graph there are these playlists.

  1. Graph Theory Part 1
  2. Graph Theory Part 2

these 2 are course.

after these for almost every platform I have playlist for practice problem

  1. Hackerearth | Graph & Tree
  2. Codeforces | Graph & Tree
  3. Codechef | Graph & Tree
  4. Spoj | Graph & Tree
2 Likes

Consider making these for LeetCode problems too, it has a large no of users and it might boost your channel…

1 Like

I have some editorials from leetcode too.
May be need to add more

1 Like

6 July 2020 : 1 editorial added
L21 : Minimum Moves for knight to reach target cell

1 Like

9 July 2020 : 1 video added
E001 : Chess Knight Moves | Codechef

1 Like

Problem - 1360E - Codeforces in this question why you @waqar_ahmad224 traverse from end in dfs

when is part 2 and 3 of this course is coming as you mentioned ?

arrey bhai :slight_smile: