Euler Path | Euler Circuit | PART-1 | Graph Concepts & Qns - 40 | Explanation+Code

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ม.ค. 2025

ความคิดเห็น • 61

  • @Dev-gb3tk
    @Dev-gb3tk ปีที่แล้ว +9

    I don't know why its underrated , its amazing

  • @TechVIP
    @TechVIP ปีที่แล้ว +24

    Haven't saw someone who is working so dedicatedly that requested for a concept and you released the video on the same day. HATSS OFF!!! Thanks a lot for this. 😍❣

  • @gauravbanerjee2898
    @gauravbanerjee2898 ปีที่แล้ว +12

    40/40 done ✅ Finally thanks a lot Bhaiya ❤️ for this playlist. You helped a lot to overcome my fear of graphs. Aapka motivation wala intro boht sahi lagta hai ❤️. Looking forward for more videos in this playlist. And Congratulations Bhaiya for 10k subscribers 🥳. Love you 3000❤️

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว +4

      It means a lot to me. Thank you so much 😇🙏❤️
      It’s a promise to bring more videos and more knowledge. ❤️❤️

    • @gauravbanerjee2898
      @gauravbanerjee2898 ปีที่แล้ว

      @@codestorywithMIK My pleasure! 😇 Looking forward to the exciting content ahead. ❤❤

    • @souravjoshi2293
      @souravjoshi2293 ปีที่แล้ว +2

      wow. How did you make Rs.40 comment ?

    • @gauravbanerjee2898
      @gauravbanerjee2898 ปีที่แล้ว +2

      @@souravjoshi2293 you can also do it via the thanks button

  • @sudhadevi6692
    @sudhadevi6692 10 หลายเดือนก่อน +4

    Thx bhaiya for this beautiful explanation of this topic❤

  • @im_ykp
    @im_ykp 3 หลายเดือนก่อน +3

    Crazy!! How well you have explained this.

  • @rakeshranjan5071
    @rakeshranjan5071 6 หลายเดือนก่อน +1

    Bhai itna accha explain kiya hai tmne. Life me kabhi nahi bhulunga

  • @ashishpatel8325
    @ashishpatel8325 หลายเดือนก่อน +2

    A new subscriber is added

  • @dayashankarlakhotia4943
    @dayashankarlakhotia4943 ปีที่แล้ว +1

    Good explanation in eulerian path start have one out degree and end have three indegree

  • @sachinmohanty4577
    @sachinmohanty4577 ปีที่แล้ว +1

    Amazing MIK❤ learnt something new before sleeping 😅.. aapke video ke liye hi pen and note hamesa bed ke side rakhta hun taki video and mera dry run ke bich dono sync rahe

  • @k-CE-OmkarPathak
    @k-CE-OmkarPathak ปีที่แล้ว +1

    Learned many new things!! Thank you

  • @souravjoshi2293
    @souravjoshi2293 ปีที่แล้ว

    Thank you so much for listening to our requests. You the best

  • @ashwaniarchivee
    @ashwaniarchivee ปีที่แล้ว +1

    Now I can say Graph is easy. Eagerly waiting for upcoming videos like Articulation points and others. Time to practice questions 😅
    Thanks Mik🥳🥳

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว +1

      So glad to hear that. Thank you so much 🙏😇❤️
      And yes sure, more videos coming soon

  • @0_7_12
    @0_7_12 หลายเดือนก่อน

    as u said in eulerian circuit we can start from any node .... if we have a graph like at 13:15 so if we take the node having no edges and we start from it ...the condition for euler path that says we must visit all the edges is not met so how we say its an eulerian cycle

    • @codestorywithMIK
      @codestorywithMIK  หลายเดือนก่อน +1

      Wow. Good Qn.
      In such case, this what I would do
      Step 1: Ignore isolated vertices when checking for connectivity.
      Step 2: Verify that all vertices with edges have an even degree.
      Step 3: Start the traversal from any vertex within the connected component that contains edges.

  • @AlishaKhan-ww3io
    @AlishaKhan-ww3io ปีที่แล้ว

    Thanks a lot for starting Euler concepts. Waiting for Part-2 ❤❤

  • @easyvedicmaths886
    @easyvedicmaths886 ปีที่แล้ว +1

    Waiting for part2, please upload soon, thanks sir!

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว

      Sure thing. Will upload as soon as I get back to India 😇🙏

  • @eprithvikushwah4754
    @eprithvikushwah4754 4 หลายเดือนก่อน

    13:58

  • @tutuimam3381
    @tutuimam3381 ปีที่แล้ว +2

    Thanks❤❤

  • @sidharthdhiman4522
    @sidharthdhiman4522 ปีที่แล้ว +1

    amazing sir

  • @wearevacationuncoverers
    @wearevacationuncoverers ปีที่แล้ว +1

    Wow, thanks a lot man

  • @archiessingh5519
    @archiessingh5519 หลายเดือนก่อน

    Bhai 19:30 mai jho aapne bola visited once , vho exactly once nahi honga euclerian path ke liye ? I think something is going wrong . Ya mai hi galat samjha hu??

  • @akhilchauhan9417
    @akhilchauhan9417 ปีที่แล้ว +1

    Pls Make a video on finding connected components in a directed graph. i.e. both Kosaraju's and Tarjan's Algorithm.

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว

      Both Kosaraju’s algorithm is already there in my playlist - th-cam.com/video/E6DeC0Zpdns/w-d-xo.htmlsi=jblQpHpplb7lKU0k
      ❤️❤️❤️

  • @FanIQQuiz
    @FanIQQuiz ปีที่แล้ว

    You are dope 🔥❣

  • @Abhay14
    @Abhay14 ปีที่แล้ว +1

    bhaiya maine ye vala lecture complete kr diya h now waiting for new videos and DSA sheet of yours

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว

      Sure thing.
      Thank you so much 😇😇❤️❤️❤️

  • @shabananoor9423
    @shabananoor9423 ปีที่แล้ว

    Wow 😲.

  • @dhairyachauhan6622
    @dhairyachauhan6622 ปีที่แล้ว +2

    Hi bhaiya aaj ke contest me ye 4th question tha graphs ka agar aapko time mile toh isse bhi samjha dena and once again thanks a lot for guiding me coz for you i was able to rank 3k/28k in today's contest 😇.
    2858. Minimum Edge Reversals So Every Node Is Reachable
    this was the question agar aapko online na mile toh leetcode contest se lelena.

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว +2

      Thank you so much for bringing this. I was looking for some Qns based on this topic so that i can cover them in this playlist. Surely I’ll cover.
      Thank you ❤️🙏😇

  • @Abhay14
    @Abhay14 ปีที่แล้ว +1

    bhai pls reply krdo mai 4+ hour se iss problem ko try krra hun leetcode flood fill (733)
    iss solution ke sare given testcase run krre h but 134th test case error de rha h pls pls help bhaiya
    class Solution {
    public:
    vectordirections = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
    bool isSafe(int row, int col, vector&grid){
    if(row >= 0 && row < grid.size() && col >= 0 && col < grid[0].size()){
    return true;
    }
    else{
    return false;
    }
    }
    void BFS(vector& image, int sr, int sc, int color, map&visited){
    visited[{sr, sc}] = true;
    queueq;
    q.push({sr, sc});
    while(!q.empty()){
    auto temp = q.front();
    q.pop();
    int x = temp.first;
    int y = temp.second;
    image[x][y] = color;
    for(auto & i : directions){
    int newX = x + i[0];
    int newY = y + i[1];
    if(isSafe(newX, newY, image) && !visited[{newX, newY}] && image[newX][newY]){
    q.push({newX, newY});
    visited[{newX, newY}] = true;
    image[newX][newY] = color;
    }
    }
    }
    }
    vector floodFill(vector& image, int sr, int sc, int color) {
    if(color == image[sr][sc]){
    return image;
    }
    mapvisited;
    // if(!visited[{sr, sc}]){
    BFS(image, sr, sc, color, visited);
    // }
    return image;
    }
    };

  • @TheWorldBeyond007
    @TheWorldBeyond007 8 หลายเดือนก่อน +1

    Bhaiya pata hai thoda late ho gya hai aur thoda late comment hai par maine Euler Circuit ke alag tarike se solve kiya hai . Euler circuit wala GFG ka . Using DSU .
    class DSU :
    def __init__(self , n):
    self.parent = [i for i in range(n)]
    self.size = [1 for _ in range(n)]

    def findParent(self , u):
    if self.parent[u] == u :
    return u
    parent = self.findParent(self.parent[u])
    self.parent[u] = parent
    return parent

    def union(self , u , v):
    parent_u = self.findParent(u)
    parent_v = self.findParent(v)
    if parent_u == parent_v :
    return 0
    size_u = self.size[parent_u]
    size_v = self.size[parent_v]
    if size_v > size_u :
    self.parent[parent_u] = self.findParent(parent_v)
    self.parent[u] = self.findParent(parent_v)
    self.size[parent_v] += self.size[parent_u]
    else :
    self.parent[parent_v] = self.findParent(parent_u)
    self.parent[v] = self.findParent(parent_u)
    self.size[parent_u] += self.size[parent_v]
    return 1
    class Solution:
    def isEularCircuitExist(self, v, adj):
    edges = []
    for i in range(len(adj)):
    edges.extend([(i , j) for j in adj[i] if i < j ])
    if len(edges) == 0 :
    return True
    dsu = DSU(v)
    for i in range(len(edges)):
    first = edges[i][0]
    second = edges[i][1]
    if dsu.findParent(first) == dsu.findParent(second):
    if i == len(adj) - 1 :
    return True
    else :
    return False
    else :
    dsu.union(first , second)
    return False
    Converted adj_list to edges to ( u, v) form .
    Now , for every edge , if the parent are different means we are not create new component , we are just exploring new path . agar parent same hue matlab we reached back to same component jisse start kiya tha , if that is last edge then True else False because we reached to same component and we have a cycle other than euler circuit .
    This passed all test cases and it works .
    Is this correct approach ?

  • @codeandtalk6
    @codeandtalk6 ปีที่แล้ว +1

    ❤❤❤

  • @k.vabhavmishra
    @k.vabhavmishra ปีที่แล้ว +1

    kal ka question isi concept par tha!

    • @FanIQQuiz
      @FanIQQuiz ปีที่แล้ว +1

      I think parso wala qn tha. Reconstruct itinerary wala shayad.

    • @dayashankarlakhotia4943
      @dayashankarlakhotia4943 ปีที่แล้ว

      Yes reconnect itineraries base on eluerian path

    • @k.vabhavmishra
      @k.vabhavmishra ปีที่แล้ว

      @@FanIQQuiz mai just Raat ke 3 baje baad code krta hu😅

    • @souravjoshi2293
      @souravjoshi2293 ปีที่แล้ว

      @@k.vabhavmishra damn 😅

  • @harshalyallewar
    @harshalyallewar หลายเดือนก่อน +1

    POTD

    • @codestorywithMIK
      @codestorywithMIK  หลายเดือนก่อน +1

      Here it is -
      th-cam.com/video/ElXqjhZoUC0/w-d-xo.htmlsi=M_aVKMkJmBXfdeEL
      Hope this helps 😇🙏❤️

  • @CodeBoost8375
    @CodeBoost8375 ปีที่แล้ว +1

    Bro today's potd

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว

      th-cam.com/video/m73DRkEo8Ko/w-d-xo.htmlsi=aRyeK2wZk2aZb2tK
      ❤️

  • @adarshdhital007
    @adarshdhital007 ปีที่แล้ว +1

    Where is today's daily challenge question ???

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว

      It’s already there in my Playlist long ago.
      You can watch here th-cam.com/video/QIu9HeyEjPc/w-d-xo.htmlsi=I3lsO_TKQDuif79S
      Thank you 🙏❤️😇

  • @SHIVAMOJHA21
    @SHIVAMOJHA21 8 หลายเดือนก่อน +1

    bhai ads ko video ke 1st ya last mein laga diya karo!...it's very annoying

    • @codestorywithMIK
      @codestorywithMIK  8 หลายเดือนก่อน

      Hello Shivam,
      Apologies for the inconvenience but TH-cam has removed our control to place ads. So unfortunately it’s out of our control to place ads.
      I hope you will understand ❤️❤️

    • @SHIVAMOJHA21
      @SHIVAMOJHA21 8 หลายเดือนก่อน

      @@codestorywithMIK okay!

  • @taarakmehtakaoolthachasmat4649
    @taarakmehtakaoolthachasmat4649 หลายเดือนก่อน +1

    sir I got 500 day strak medal

  • @gsgpavan1897
    @gsgpavan1897 8 หลายเดือนก่อน

    O O--O
    \ /
    O
    Hi MIK, If we start from the 1st component, we never reach any edge of 2nd component, then why are we saying this as a eulerian graph