G-2. Graph Representation in C++ | Two Ways to Represent

Поделиться
HTML-код
  • Опубликовано: 13 янв 2025

Комментарии • 329

  • @takeUforward
    @takeUforward  2 года назад +72

    Lets continue the habit of commenting “understood” if you got the entire video.
    Do follow me at Instagram: striver_79

    • @raghvendrakhatri5848
      @raghvendrakhatri5848 2 года назад

      Understood each and every word♥️. Kudos to your hard work and dedication, you are the motivation behind a lot of people. Your hardwork inspires a lot of people to work hard.
      Thankyou for providing such a beautiful graph series keep posting such content ♥️, we all need this.

    • @nisha_k22
      @nisha_k22 2 года назад +1

      @take U forward the complexity at 6:44 if it is 0 indexed should be n*n or n*m ? and the complexity at 7:17 should be O(m) I guess . Please let me know

    • @terrorwizard4055
      @terrorwizard4055 2 года назад

      @@nisha_k22 You are right

    • @BhavyaJain-qz8jg
      @BhavyaJain-qz8jg Год назад

      understood

  • @raregem7995
    @raregem7995 6 месяцев назад +79

    In the adj matrix code at 06:37 there will be adj[n+1][n+1], not adj[n+1][m+1]. We all understood this from your explanation. Thank you for such great playlists.💛

    • @ASHUTOSHSHARMA-us6hd
      @ASHUTOSHSHARMA-us6hd 5 месяцев назад +1

      HA WOHI
      MAI SOCH RHA THA

    • @prashikganer4820
      @prashikganer4820 Месяц назад

      Yeah thanks. I was a bit confused too.

    • @anshakki7838
      @anshakki7838 Месяц назад

      how space complexity is 0(2e) in list as we also have to count space for the array made to store the list

    • @danielredcliff235
      @danielredcliff235 26 дней назад

      @@anshakki7838 vector is a dynamic array , so initially its size will be zero, and grows only when you push_back something

  • @ShreyanshSingh-n6k
    @ShreyanshSingh-n6k 7 месяцев назад +50

    2D Vector (vector)
    Dynamic: Both dimensions (rows and columns) can be resized dynamically.
    Usage: Suitable when the number of vertices is not known at compile time or can change.
    Syntax: vector adjList(vertices);
    Array of Vectors (vector adj[])
    Fixed Outer Dimension: The number of rows (vertices) is fixed at compile time.
    Dynamic Inner Dimension: The number of columns (edges per vertex) can change dynamically.
    Usage: Suitable when the number of vertices is known and fixed at compile time.
    Syntax: vector adj[n+1];

  • @tasneemayham974
    @tasneemayham974 Год назад +17

    I finished the ENTIRE dp series. THE BESSTTT. Now I am here for graphss!!
    Thank youu sooo much Striver!!!

    • @harshitrautela6585
      @harshitrautela6585 6 месяцев назад +1

      do you suggest completing graph or dp series before?

    • @tasneemayham974
      @tasneemayham974 6 месяцев назад +2

      @@harshitrautela6585 Honestly, DP. Because I feel its problems are more interesting than graphs and I generally like recursion more. Also, when Striver teaches it you really feel ADDICTED. It's soooo much more immersive than graphs.
      But it's up to you. The disadvantage of going with DP is you have to complete the recursion series first as a prerequisite, and it's longer than the graph series.

    • @Josuke217
      @Josuke217 6 месяцев назад

      ​@@tasneemayham974I learned recursion from love Babbar but I still suck at it , is Striver's recursion playlist good? Also should I make notes or just learn the topic and apply it? I am asking this because I am confused and don't know how to move forward

    • @tasneemayham974
      @tasneemayham974 6 месяцев назад +1

      @@Josuke217 I don't know Babbar. But I know that once I learned recursion from Striver, I didn't need to open any other RUclips video. It IS this good. And YESS definitely make notes. I learn and memorize better when I take notes. Learning goes both ways: note-taking and skill application.
      I know how you feel. Currently, I am stuck too. My Graph series Notes were destroyed because of water contact. I am soooo downnn!! 😥😥😥

    • @Josuke217
      @Josuke217 6 месяцев назад +1

      @@tasneemayham974 thanks , is the recursion series complete? Because someone told me striver has skipped some topics.

  • @MrAmitparida
    @MrAmitparida 2 года назад +31

    Some compilers like Visual C++ don't support variable length arrays. So you will get compilation error for using non-constant n and m as array indexes. In that case you can use vector as follows:
    //Adjacency Matrix representation
    ===========================
    #include
    #include
    using namespace std;
    int main() {
    int nodes, edges, u, v;
    cin >> nodes >> edges;
    // declare the Adjacency matrix
    vector adj;
    adj.resize(nodes + 1);
    // take edges as input
    for (int i = 0; i < edges; i++) {
    cin >> u >> v;
    adj[u][v] = 1;
    adj[v][u] = 1;
    }
    return 0;
    }
    //Adjacency List representation
    =========================
    #include
    #include
    using namespace std;
    int main() {
    int nodes, edges, u, v;
    cin >> nodes >> edges;
    // declare the Adjacency list
    vector adj;
    adj.resize(nodes + 1);
    // take edges as input
    for (int i = 0; i < edges; ++i)
    {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
    }
    return 0;
    }

    • @srianshumahadas7178
      @srianshumahadas7178 Год назад +3

      At last, I was racking my head trying to understand how using vector we were able to represent a 2D matrix. Thanks, bro

    • @MrAmitparida
      @MrAmitparida Год назад

      @@srianshumahadas7178 Welcome!
      int matrix[M][N] can be represented as vector matrix(M, vector(N)) .

  • @mayank_rampuriya
    @mayank_rampuriya Год назад +27

    It would be better if we use *map m* rather than *vector v[n+1]*

    • @Surya77_6
      @Surya77_6 9 месяцев назад

      Why bro

    • @divyam-hx3ie
      @divyam-hx3ie 7 месяцев назад +1

      @@Surya77_6 because we have a vector corresponding to single integer, example 1 is connected to 2 and 3 so, key is 1 and have value in the form of vector containing 2 and 3

    • @POTNURURAHULADITHYA
      @POTNURURAHULADITHYA 3 месяца назад

      yeah even i thought of the same , does vector v[n+1] work well for code? please answer

    • @le-delta141
      @le-delta141 Месяц назад

      ​@@POTNURURAHULADITHYA Yes it works well in code. vector a[n] is just an "array of vectors". Pretty much the same thing as "vector a"

  • @vibhanshugarg3603
    @vibhanshugarg3603 2 года назад +8

    the best explanation of graphs till now... thanks striver

  • @gokulbansal1038
    @gokulbansal1038 11 месяцев назад +31

    For storing in adjacency matrix, it will be int adj[n][n] if nodes are numbered from 0 to n-1 and adj[n+1][n+1] if nodes are numbered from 1 to n

    • @garvgoel1743
      @garvgoel1743 11 месяцев назад +2

      yes... even I was thinking the same during the lecture

    • @johnxina7496
      @johnxina7496 10 месяцев назад +3

      why n+1

    • @satyampratap3808
      @satyampratap3808 10 месяцев назад +2

      @@johnxina7496 Because of 1-based indexing, if you'll take it n then n-th node will not get added.

    • @GoUrAvpandey-g7r
      @GoUrAvpandey-g7r 8 месяцев назад +2

      he also did a mistake of taking n+1 * m+1 it should be n+1 * n+1

  • @vikaskumaryadav3529
    @vikaskumaryadav3529 Год назад +11

    I just wanted to say that u are pure gem for us and keep going the way you are going. Lots of thanks 🙏🙏

  • @fuzi_blossom
    @fuzi_blossom Год назад +10

    //Thanku so much striver bhaiya for this amazing content ❤
    //I have made a complete gist of this video in the code written below in C++
    #include
    using namespace std;
    int main()
    {
    // Graph is a finite set of vertices and edges
    // total degree of undirected graph=2*Total edges
    // for directed graph degree is represented in terms of indegree and outdegree
    //degree of a vertex is defined as the no of edges attached with it
    int n, m;
    cout > n;
    cout > m;
    vector adj(n + 1, vector(m + 1, 0));
    vector adj_list[n + 1];
    for (int i = 1; i > v1 >> v2>>wt;
    adj[v1][v2] = wt;
    adj[v2][v1] = wt;//remove this line for directed graph
    adj_list[v1].push_back({v2,wt});
    adj_list[v2].push_back({v1,wt});//remove this line for directed graph
    }
    //---------ADJACENCY MATRIX-------------------//
    // space complexity for undirected graph= O(V*V)
    // space complexity for directed graph : O(V*V)
    cout

  • @molyoxide8358
    @molyoxide8358 2 года назад +10

    from past 3-4 months I was running away from the graph but I got some hope after watching this video. 😍

  • @udityakumar9875
    @udityakumar9875 Год назад +30

    adjacency list is vectoradj. right? and not just 1d vector

    • @rohithparepalli9237
      @rohithparepalli9237 11 месяцев назад +4

      Yeah same doubt

    • @shivgoyal103
      @shivgoyal103 10 месяцев назад +1

      han bhai same doubt mera bhi .

    • @ritabhsharma6627
      @ritabhsharma6627 9 месяцев назад +63

      Its not a 1-D vector. Its aa array of vector.
      see it this way.
      How a 1-D vector is declared : vector adj(n+1);
      How an array of vectors is declared : vector adj[n+1];
      Do you observe the difference between ( ) and [ ] ? Now you do :D

    • @harsha4048
      @harsha4048 7 месяцев назад

      ​@@ritabhsharma6627🙌

    • @VivekKumar-kf8yc
      @VivekKumar-kf8yc 6 месяцев назад +1

      @@ritabhsharma6627 Thank you so much. I could never understand how he was able to store a list in a vector. Thanks for clearing my doubt.

  • @rajkamalingle9144
    @rajkamalingle9144 Год назад +7

    @7:16 Time complexity to store the adjacency matrix would be O(m) and not O(n)

  • @ashishparmar762
    @ashishparmar762 Год назад +1

    00:03 Learn how to represent a graph in C++ or Java
    02:05 Learn how to store edges in a graph using an adjacency matrix or a list.
    04:07 Creating an adjacency matrix to represent edges between nodes
    06:09 Storing a graph using adjacency list takes less space than n square method
    08:15 Adjacency list stores neighbors of a node
    10:12 Using adjacency list for graph storage
    12:22 Learned how to store graphs using adjacency list and matrix
    14:13 Store weights in pairs instead of single integers
    Crafted by Merlin AI.

  • @tastaslim
    @tastaslim Год назад +8

    The adjacency matrix is better if we are concerned about time complexity as it finds edge b/w nodes in O(1). Yes, in the case of something like a sparse graph, we should prefer an adjacency list otherwise we would waste too much space.

  • @DevanshuAugusty
    @DevanshuAugusty Год назад +10

    15:20 so for this it would be: vector adj[n+1] .... right?

    • @vivek03501
      @vivek03501 Год назад +1

      no it should be vector adj(n+1);

  • @akhirulislam4079
    @akhirulislam4079 2 года назад +181

    I feel the matrix should be like adj[n+1][n+1] not adj[n+1][m+1]

    • @vishvrajbaan6634
      @vishvrajbaan6634 Год назад +8

      yes this right

    • @ProSol-im6zn
      @ProSol-im6zn Год назад

      Can u say
      How do u know those matrix

    • @ProSol-im6zn
      @ProSol-im6zn Год назад

      I don't have a proper idea about adj[n+1]

    • @Lolzzzzz77
      @Lolzzzzz77 Год назад +4

      Ya I wasss about to comment this

    • @SsjRose26
      @SsjRose26 Год назад +8

      ​@@ProSol-im6znbro, if there no of edges depends upon the no of nodes, so we need adj[n+1][n+1], total of n*2 edges possible, what he typed was a mistake in the video

  • @mriduljain6809
    @mriduljain6809 2 года назад +6

    Understood Bhaiya
    We can also use this for representing adjacency list:
    unordered_map list

  • @tejashsingh2060
    @tejashsingh2060 2 месяца назад +2

    7:20 dimensions of matrix should be n+1, n+1

  • @itsmeakash_
    @itsmeakash_ 2 года назад +26

    6:42 why is the matrix is [n+1][m+1] but previously u told [n+1][n+1]?

    • @ArnabJhaYT
      @ArnabJhaYT 2 года назад

      because in total, there are only n vertices. we dont care about the number of edges here as we can store any edge in the matrix format.

    • @mahaprasadm9770
      @mahaprasadm9770 2 года назад +5

      I think it's a typing mistake.

    • @ArnabJhaYT
      @ArnabJhaYT 2 года назад +1

      @@dravitgupta7927 maybe I was unclear in what I meant. I meant that (n+1)(n+1) should be the size, because the number of edges(m) don't matter, but the number of vertices(n) matters. Try reading my old comment once again.

    • @dravitgupta7927
      @dravitgupta7927 2 года назад

      @@ArnabJhaYT Got it👌.

    • @aasthadubey3321
      @aasthadubey3321 2 года назад +1

      @@ArnabJhaYT yes number of edges won't matter here

  • @valendradangi1822
    @valendradangi1822 8 месяцев назад +2

    Bhiya at 7:10 adjacency matrix should be of (n+1)*(n+1) size and not (n+1)*(m+1).

  • @rumiNITPatna
    @rumiNITPatna 2 месяца назад +1

    thank u so much striver. amazing video

  • @rishabhkumar-qs3jb
    @rishabhkumar-qs3jb 7 дней назад

    Take you forward rocks, amazing video:)

  • @atulkohar6959
    @atulkohar6959 5 месяцев назад +2

    I don't get this part where he says he says he using list to store the graph values. But he only define the structure like vector and later vector but how will he store multiple values on one index as he defined it. In both the approaches he is using a 2d array

    • @khechraay
      @khechraay 5 месяцев назад

      bro he is using array of vectors `vector adj[n+1]`

    • @Himanshuuu0-0
      @Himanshuuu0-0 2 месяца назад

      ​@@khechraaycould you please elaborate

  • @shubhamsukum
    @shubhamsukum 2 года назад +9

    vector adj[n+1];
    means => vector adj(n+1);
    Correct me if I am wrong?

    • @viz_dugz
      @viz_dugz 2 года назад +4

      something i got stuck on myself, didn't notice the square brackets

    • @tanishgupta7879
      @tanishgupta7879 2 года назад +1

      it's a vector of array. Try to read it from right to left. At each index there is an empty vector.

    • @Shrutikahilale
      @Shrutikahilale Год назад +4

      when we declare an array of integers of size n, we say int arr[n] so we say the datatype is int. Here, we want to create an array of vectors (of type int) hence, vector arr[n+1] of size n+1.

    • @DevanshuAugusty
      @DevanshuAugusty Год назад +5

      @@tanishgupta7879 you mean array of vectors

  • @vani.sharmaa
    @vani.sharmaa 2 года назад +5

    vector adj[n+1] basically means a vector of arrays right? so can we also declare it as vector of vectors?

    • @mohakhiphop
      @mohakhiphop 2 года назад +1

      Yes, which is adjacency matrix but it takes more space

    • @mohakhiphop
      @mohakhiphop 2 года назад

      @@rahulshah2685 no its right , vector[] is array of vector i.e. 2 d array

    • @DevanshuAugusty
      @DevanshuAugusty Год назад

      @@mohakhiphop well vector of vector will take more space if we already declare the size. But the space will be same as vector adj[] if we store in a way so that it doesn't take extra space.

    • @mohakhiphop
      @mohakhiphop Год назад +1

      @@DevanshuAugusty yep true💯

  • @sripriyapotnuru5839
    @sripriyapotnuru5839 2 года назад +2

    Thank you, Striver 🙂

  • @shubhamsanodiya8368
    @shubhamsanodiya8368 2 года назад +1

    UnderStood Thanks for this amazing series

  • @juniorboy1903
    @juniorboy1903 2 года назад +2

    Bhaiya itna deep kisi ne nhi samjhaya "Understood😉" Maja aa gaya

  • @cinime
    @cinime 2 года назад

    Understood! Great explanation as always, thank you very much!!

  • @ramanpareek5218
    @ramanpareek5218 6 месяцев назад

    Liked the video, notes taken, understood

  • @hashcodez757
    @hashcodez757 5 месяцев назад

    "UNDERSTOOD BHAIYA!!"

  • @sujalgupta6100
    @sujalgupta6100 2 года назад +8

    Okay, I was watching your previous playlist yesterday , and in that you said space complexity of Adjacency list is O(V+2E) which i didn't understood.
    Now, I came across this video in which it is O(2E) and I understood it. I know they are almost same but I want to know why did we add V in the space complexity in the old video .

    • @takeUforward
      @takeUforward  2 года назад +22

      Yes, I went through all the comments of those videos, and making sure I cover things which people were having doubts 😅
      The addition of V was for the list creation. The list itself takes N space.

  • @ronakslibrary8635
    @ronakslibrary8635 Год назад

    US , Excited for learning graph

  • @GauravChaudharyNITW0501
    @GauravChaudharyNITW0501 2 года назад +1

    Best graph explanation🙌🏻🙌🏻

  • @ishmeetsinghsaluja4089
    @ishmeetsinghsaluja4089 Год назад +2

    at 6:40 the 2D array u made should be of size (n+1)X(n+1), u made it (n+1)X(m+1) by mistake

  • @PCCOERCoder
    @PCCOERCoder Месяц назад

    Lecture successfully completed on 02/12/2024 🔥🔥

  • @slemanabbas7720
    @slemanabbas7720 5 месяцев назад

    I am very lucky because I found you❤🎉🎉

  • @bhavkushwaha
    @bhavkushwaha 6 месяцев назад

    Thankyou Striver, Understood!

  • @pipinstallpycaret4056
    @pipinstallpycaret4056 3 месяца назад

    I love this, what a tutotial.

  • @thisisrajneel
    @thisisrajneel 2 года назад +5

    At 7:15 why is the matrix size [n+1][m+1] instead of [n+1][n+1]?

    • @takeUforward
      @takeUforward  2 года назад +1

      1 based indexing of graphs.

    • @thisisrajneel
      @thisisrajneel 2 года назад +3

      @@takeUforward I understand that, but why would the space taken by the matrix be O(nm) instead of O(n^2)?

    • @hrithik7354
      @hrithik7354 2 года назад +3

      @@thisisrajneel yes matrix size is [n+1][n+1] & SC O(n * n). IG it happened by mistake by him. it's okay.

    • @astronomycosmology4888
      @astronomycosmology4888 2 года назад

      please clarify striver @take u forward

    • @divyansh2212
      @divyansh2212 2 года назад

      @@astronomycosmology4888 It is a mistake only

  • @antorMorsalin
    @antorMorsalin 7 месяцев назад +1

    For adjacency list, shouldn't it be vector< vector > adj(n+1) ; ???

    • @shivanibaliyan7276
      @shivanibaliyan7276 7 месяцев назад +1

      vector adj[n+1]- This is not 1D Vector. This is array of Vectors. Here (n+1) are vectors. In an array of vectors, each element (or index) of the array is itself a vector.
      vector adj(n+1); - This is 1D vector. Here we only 1 vector having (n+1) elements.
      This is due to the difference between ( ) and [ ].

    • @antorMorsalin
      @antorMorsalin 7 месяцев назад

      @@shivanibaliyan7276 I did not notice the third bracket at first. Yes it is a Vector of Arrays

  • @NitinBhadoriya-jg9uk
    @NitinBhadoriya-jg9uk Год назад

    06:39 : it should be adj[n+1][n+1] instead of adj[n+1][m+1]

  • @nathonluke4058
    @nathonluke4058 2 года назад +10

    Hi Loved it... Great Explanation from scratch.
    And also as i read your community post. I think the audio quality has changed. In L1 the audio quality was kind of good, but in this there is a lot of disturbance. Also i liked the red colored Writing (specially when it fades after explaning) Loved the details.♥️♥️♥️

    • @shantohossain1372
      @shantohossain1372 Год назад

      his explanition is the worst ever, kunals, shardha didis explination is far better than his

  • @PRALAY.THAKUR
    @PRALAY.THAKUR Год назад +1

    very nice explanation

  • @user-bt6mh9ez3u
    @user-bt6mh9ez3u 7 месяцев назад

    Awesome Video..understood everything

  • @p38_amankuldeep75
    @p38_amankuldeep75 2 года назад +1

    great explanation ! loving this series!!💙💙💙

  • @ayushisoni4962
    @ayushisoni4962 8 месяцев назад +1

    Great content and explanation
    Shouldnt the size of adj in 6.57 be [n+1][n+1] instead of [n+1][m+1] ?

  • @TON-108
    @TON-108 9 месяцев назад +1

    i started graph but still got confused in this 👇🏼
    vector v[n] and vector v(n) are they same ??? 😭

  • @ssbcodes2654
    @ssbcodes2654 2 года назад +3

    Hey, why didn't we use 2D-vector in place of this?
    Creating array of vectors looks confusing.

    • @takeUforward
      @takeUforward  2 года назад +3

      Array of vectors takes lesser space!

    • @ssbcodes2654
      @ssbcodes2654 2 года назад +3

      @@takeUforward is it because of double the size property?
      What if we define size of 2d-vector beforehand?
      Something like below:
      vector adjList(n+1, vector(m+1))
      Only asking this because array of vectors was not so intuitive to me atleast :')

  • @MidoValo
    @MidoValo 2 года назад

    Understood! Great explanation

  • @tejeshgadde2500
    @tejeshgadde2500 2 месяца назад +1

    found this graph series playlist late🙁

  • @rishabhagarwal8049
    @rishabhagarwal8049 2 года назад

    Understood Sir, Thank you very much

  • @morganyu3391
    @morganyu3391 2 года назад

    Understood Bhaiya 👍

  • @Sarkar.editsz
    @Sarkar.editsz 2 года назад

    Thanks a lot dear brother ❤❤ , understood fully

  • @deepakagrawal2392
    @deepakagrawal2392 2 месяца назад

    Thank you for sharing. However, it seems the statement m can be 'anything' is incorrect. There is an upper limit to m, which is P(n, 2) (in the case of a directed graph)

  • @anuraganand5700
    @anuraganand5700 Год назад +1

    Heyy striver you had done mistake in definig the code for adjacent matrix as @6:43

    • @anuraganand5700
      @anuraganand5700 Год назад

      As there are n nodes so it will have a matrix for nXn

  • @mohdfarhannawaz
    @mohdfarhannawaz 2 месяца назад

    very great explaination

  • @yashshukla1637
    @yashshukla1637 Месяц назад

    Done. Thank you so much!!

  • @sumitkanth5349
    @sumitkanth5349 Год назад +1

    After filling the adjacent list with edges and weight the size of adjacent list is showing 0, why ? ( Code is given below and size is printed in line no. 8 ) thanks :)
    // CODE FOR WEIGHTED GRAPH
    1. int n,m;
    2. cout > n;
    4. cout > m;
    6. vector adj[n+1];
    7. for(int i=0; i u >> v;
    cout > w;
    adj[u].push_back({v, w});
    adj[v].push_back({u,w});
    }
    8. cout

  • @rajkamalingle9144
    @rajkamalingle9144 Год назад

    @3:14 m can't be anything, in a dense graph : m = (n * (n-1))/2

  • @KapilMaan-vw9sd
    @KapilMaan-vw9sd 5 месяцев назад

    amazing video sir ji

  • @sukhpreetsingh5200
    @sukhpreetsingh5200 2 года назад

    just awesome pure gold

  • @paone9851
    @paone9851 9 месяцев назад

    6:00 island problem

  • @akkisharma7552
    @akkisharma7552 2 года назад +1

    Happy teachers day

  • @supriyakushwaha21
    @supriyakushwaha21 3 месяца назад

    can you show graph representation in Python too? Like in upcoming videos? for beginners.

  • @divyanshbhatt8273
    @divyanshbhatt8273 11 месяцев назад

    what are we going to do if, in a graph, I have just two nodes and the value is 1 and 10^5 then we won't have the index 10^5 with us to fill!

  • @_hulk748
    @_hulk748 Год назад

    understood sir🙏❤🙇‍♂

  • @n.o.t.y.e.t
    @n.o.t.y.e.t 5 месяцев назад

    Is the adjacency list representation is same in Java or another could you please explain this in another video

  • @rishabhgupta9846
    @rishabhgupta9846 2 года назад

    great explanation

  • @dhivyashri6554
    @dhivyashri6554 2 года назад

    understood, ty, u r the best

  • @samuelfrank1369
    @samuelfrank1369 Год назад

    Understood. Thanks a lot.

  • @careerwithmann481
    @careerwithmann481 Год назад

    understood bhaiya.

  • @HARSHharsh-j6x
    @HARSHharsh-j6x 6 месяцев назад

    @takeUforward
    how to solve if node is negatives??
    like how you represents {(-1 --> 3),

    • @Ekam873
      @Ekam873 3 месяца назад

      i believe we can use mod to convert it to positive index and use pair where we can create a bit to show if nod is negative or positive just like we did to store weights of edges

  • @nisheetkaran3200
    @nisheetkaran3200 Год назад +1

    6:31
    adj[n+1][n+1];

  • @saiprasad6470
    @saiprasad6470 9 месяцев назад

    vector v[n] and vector v(n) are they same ???

    • @vedchaudhari6587
      @vedchaudhari6587 8 месяцев назад +1

      Yes means you can store similar data in both just difference is
      First one is Array where each element is vector ,
      Second is Vector of size n where each element is vector

  • @vikasbagri1225
    @vikasbagri1225 2 года назад

    understood very well...

  • @ANURAGSINGH-nl2ll
    @ANURAGSINGH-nl2ll Год назад

    understood thank you 🙂

  • @abhinandanvyas4087
    @abhinandanvyas4087 Год назад

    Why did he remove all the leetcode links they were such a great help

  • @MidoValo
    @MidoValo 2 года назад

    i hope this like button is recursive for u man

  • @ashitasrivastava681
    @ashitasrivastava681 Год назад

    UNDERSTOOD!

  • @DevashishJose
    @DevashishJose Год назад

    understood. Thank you

  • @deepakbhallavi1612
    @deepakbhallavi1612 2 года назад

    Understood 💥

  • @sameera9133
    @sameera9133 Год назад

    Sir, apni face window ek corner me kr dijiye. That will be good.

  • @worthlessguy1621
    @worthlessguy1621 9 месяцев назад

    understood striver :)

  • @Learnprogramming-q7f
    @Learnprogramming-q7f 8 месяцев назад

    Thank you Bhaiya

  • @abhaysinghchauhan4521
    @abhaysinghchauhan4521 2 года назад +2

    Understood!

  • @sreeharshakancharla5004
    @sreeharshakancharla5004 2 года назад +1

    This channel aldready had graphs playlist right.....why striver is repeating again?

  • @rahulr9301
    @rahulr9301 Год назад

    can anyone please explain me what is zero bases and 1 based node??

  • @niteshsaxena03
    @niteshsaxena03 7 месяцев назад

    awesome video

  • @sounaksaha1455
    @sounaksaha1455 2 года назад

    Content writing internship k liye apply Kiya hai... Ha na kuch to bata dijiye

  • @AbhishekThakur-gz6ul
    @AbhishekThakur-gz6ul 2 года назад

    Understood ☺️😄

  • @AdityaSingh-uy8ms
    @AdityaSingh-uy8ms 3 месяца назад

    UNDERDTOOD !!

  • @niyamaliyakkal
    @niyamaliyakkal 5 месяцев назад

    understood ❤‍🔥

  • @UECAshutoshKumar
    @UECAshutoshKumar Год назад +1

    Thank you sir

  • @vakhariyajay2224
    @vakhariyajay2224 2 года назад

    Thank you very much. You are a genius.

  • @stl8857
    @stl8857 Год назад

    does this playlist also contains trees?

  • @oqant0424
    @oqant0424 2 года назад

    2/56 done (3.12.22)

  • @siddheshborse3536
    @siddheshborse3536 2 года назад

    Understood...
    😊

  • @VarunKaushal-zx9zq
    @VarunKaushal-zx9zq 5 месяцев назад

    Thank you so much