1049 - One Way Roads
Topic: DFS
concept: কস্টকে ডিরেক্টটেড ধরবো তারপর আনডিক্টটেড গ্রাফ এ ডিএফএস চালাবো.
let's start Code
Time Complexity: If we assume that insertion in a bucket takes O(1) time then steps 1 and 2 of the above algorithm clearly take O(n) time. The O(1) is easily possible if we use a linked list to represent a bucket (In the following code, C++ vector is used for simplicity). Step 4 also takes O(n) time as there will be n items in all buckets.
01. বাইনারি সার্চ – ১(শাফায়েত আশরাফ)Binary Search
complexity: O( nodes + edges).
Problem:
1. PPATH - Prime Path
2. ONEZERO - Ones and zeros
3. WATER - Water among Cubes
4. KATHTHI - KATHTHI
5. NAKANJ - Minimum Knight moves !!!
1. Chef and Digit Jumps
1. 10004 - Bicoloring
2. 336 - A Node Too Far
3. 567 - Risk
4. 10653 - Bombs! NO they are Mines!!
5. 439 - Knight Moves
6. 762 - We Ship Cheap
7. 429 - Word Transformation
1094 - Farthest Nodes in a Tree ( tree Diameter)
1257 - Farthest Nodes in a Tree (II) (tree diameter)
E-Maxx blog problemlist link