How To Represent Trees and Graphs in Code | Adjacency Matrix & List | CP Course | EP 69

Поділитися
Вставка
  • Опубліковано 24 лип 2024
  • Graph/Trees Playlist : • Graph & Trees Course
    ALL CP/DSA RESOURCES : linktr.ee/iamluv
    FREE COMPETITIVE PROGRAMMING COURSE PLAYLIST : • Competitive Programmin...
    In this videos I explain How you can represent Tree/Graph in Code using Adjacency matrix or Adjacency list
    Timestamps:
    Adjacency Matrix: 0:00
    Adjacecny List: 11:06
    Be a part of our awesome Community. Join
    ○ Discord : / discord
    ○ Telegram : t.me/LuvIsMeYT
    You can follow me on below platforms for all the latest updates
    ○ Instagram : / i._m_.luv
    ○ Twitter : / luvk1412
    ○ Linkedin : / luvk1412
    Blog(Not frequently updated)
    ○ Blog : www.codewithluv.in
    Hashtags
    #adjacency #matrix #list #graph

КОМЕНТАРІ • 468

  • @rishabhverma7730
    @rishabhverma7730 2 роки тому +64

    💛💛💛
    1. In cp mostly the vertices are 1 based.
    2. Most of the question are done by DFS
    3. You can also use the vector of vector as an alternative.

    • @mahdi-hasan
      @mahdi-hasan Рік тому

      Thank you. Shouldn't we use Nodes like linked list to represent graphs/trees?

  • @rishantkumar2408
    @rishantkumar2408 2 роки тому +16

    Plz add "aisa kuch khaas nahi hai , bas aise hii naam de diya hai" ... It has special effect.... 💛💛💛

  • @falcon4359
    @falcon4359 2 роки тому +14

    Your explainations are amazing, you always seem to know and care aboout the minute details I aspire to be as skilled as that 💛💛💛

  • @binary6208
    @binary6208 2 роки тому +8

    Aap pdhate ho to poora 100% samajh me aata hai expecting much in this graph/tree series

  • @naha_ne_ja_nahane
    @naha_ne_ja_nahane 2 роки тому +39

    You deserve more subscriber 🔥🔥

  • @amisha2545
    @amisha2545 2 роки тому +3

    🔥your explanations are incredible. you are so underrated tbh. This graph series is better than striver’s graph series tbh.

  • @parthkabra8880
    @parthkabra8880 2 роки тому +5

    Thanks for the bit manipulation one

  • @ShyToSassySaga
    @ShyToSassySaga 2 роки тому +3

    You are a great teacher.Thank you so much

  • @pavans3283
    @pavans3283 2 роки тому

    amazing to the point loved it 💛

  • @arifmulani7130
    @arifmulani7130 Рік тому

    💛 The course to rule them all !!

  • @abirpal501
    @abirpal501 2 роки тому

    17:10 vector graph2[N]
    💛💛💛💛💛

  • @yugal8627
    @yugal8627 Рік тому

    💛💛💛💛💛💛💛 Thanks, Luv U are a wonderful teacher. You teach the very confusing concepts very easily. I'll wait for more such vdo from U.

  • @gouravkumarshaw5467
    @gouravkumarshaw5467 Рік тому +1

    Awesome Explanation Thanks!!!!!😇

  • @sawvikdipto3087
    @sawvikdipto3087 Рік тому

    Your explanation is awesome, Thank you .

  • @rumar1071
    @rumar1071 2 роки тому

    You r the most underrated ds tutor i think

  • @aniketpawar9207
    @aniketpawar9207 2 роки тому

    easy and simple explanation given by luv thanks

  • @itsyadavraj
    @itsyadavraj 2 роки тому +4

    thank you so much sir provide awesome lectures 🔥🔥

  • @utkarshgautam1940
    @utkarshgautam1940 2 роки тому

    love to see u bhaii,keep making vedioes,u are awsome,we need pepole like u

  • @aryanagrawal3719
    @aryanagrawal3719 2 роки тому +1

    awesome man!

  • @kunalprajapati5959
    @kunalprajapati5959 2 роки тому

    we will take vector of pair, i.e vector

  • @Shubham_Kanojia_56
    @Shubham_Kanojia_56 2 роки тому

    Best channel for cp 🔥🔥🔥

  • @ketanrathod2064
    @ketanrathod2064 2 роки тому

    😁🧡💛great course with good speed that i like most ..

  • @ashikghosh6166
    @ashikghosh6166 Рік тому

    luved this!💥💥❣❣

  • @MukulKumar-mb6ld
    @MukulKumar-mb6ld 2 роки тому +2

    osm bheya you are grate 💛💛💛

  • @riteshraj64
    @riteshraj64 Рік тому

    Amazing as always 💛💛

  • @mycourse1551
    @mycourse1551 Рік тому +4

    While creating the adjacency list should'nt it be:
    vector graph2;

  • @raghavgarg5273
    @raghavgarg5273 Рік тому

    Awesome videos bro thanks!!

  • @utkarshshukla9768
    @utkarshshukla9768 2 роки тому

    💛💛 Clear explanation!

  • @md.nurulalam6462
    @md.nurulalam6462 2 роки тому +1

    💛 love you Bhai concept clear 🙂

  • @himanshujha7919
    @himanshujha7919 29 днів тому

    best #dsa #tutor and best #graph playlist............💛💛💛💛💛💛💛💛💛💛💛💛

  • @sakshi-ok8zu
    @sakshi-ok8zu 2 роки тому

    mja aa gya ~
    amazing explanation!

  • @chetanpatil1034
    @chetanpatil1034 2 роки тому +1

    Bhiya you are a great teacher of all time please make more videos on graph

  • @shaikhmohdtehami7923
    @shaikhmohdtehami7923 6 місяців тому

    💛💛 Great Explaination

  • @Suuuuuuuuuuuuuubrat
    @Suuuuuuuuuuuuuubrat 2 роки тому

    Your videos are awesome 💛💛💛

  • @_PB03
    @_PB03 2 роки тому

    💛💛💛as always to the point :)

  • @rickk3300
    @rickk3300 2 роки тому +1

    Awesome lecture 💛

  • @JbpVlogs35
    @JbpVlogs35 2 роки тому +2

    Op bro full support you bro

  • @tusharyadav3834
    @tusharyadav3834 Рік тому

    love for luv , love for cp

  • @DeepakVerma-iitbhu
    @DeepakVerma-iitbhu 2 роки тому +1

    💛 thanks bhaiyya

  • @mogaon9489
    @mogaon9489 Рік тому

    💛 Thank you very much

  • @yashsinghal7471
    @yashsinghal7471 Рік тому +1

    💛💛💛💛 really helpful

  • @collegebkchodi6687
    @collegebkchodi6687 2 роки тому +1

    Luv=Love💛

  • @kalyanvivek2852
    @kalyanvivek2852 Рік тому

    💛💛💛💛
    Awesome explanation.

  • @dhruvmehta957
    @dhruvmehta957 Рік тому

    🧡I guessed the pair thing right.❣

  • @wasifshahzad5001
    @wasifshahzad5001 5 місяців тому

    vector graph[N];

  • @gonfreeces5514
    @gonfreeces5514 2 роки тому

    Great video 💛

  • @srujanhere8572
    @srujanhere8572 2 роки тому

    Great work bro 💛💛💛

  • @BrijeshYadav-hr4nz
    @BrijeshYadav-hr4nz 2 роки тому

    excellent explanation 💛

  • @dhruvilsavani5287
    @dhruvilsavani5287 2 роки тому

    really amazing explanations and i believe you will be uploaded more video

  • @relaxationmantra3498
    @relaxationmantra3498 2 роки тому

    💛💛💛💛💛 ek kyu mai to bahut sare dunga..... Please jaldi jaldi graph ke videos upload kar do bhaiya.

  • @saket61195
    @saket61195 2 роки тому

    💛💛 beautiful explanation

  • @sahilanand30
    @sahilanand30 2 роки тому +1

    Nicely explained

  • @sahilanand30
    @sahilanand30 2 роки тому +1

    Best explanation

  • @varadacharya2802
    @varadacharya2802 Рік тому

    ♥♥♥♥ too good explanation

  • @TataG29
    @TataG29 Рік тому

    Thank you Sir🧡🧡

  • @rocknapier1293
    @rocknapier1293 2 роки тому +1

    👍 great explanation

  • @iqramueed1267
    @iqramueed1267 2 роки тому

    you are amazing 💛

  • @aloo0p838
    @aloo0p838 Рік тому +1

    💛💛💛 nice explanations

  • @mehedihasansabbir7886
    @mehedihasansabbir7886 2 роки тому

    Thanks a lot, brother.

  • @itz_me_imraan02
    @itz_me_imraan02 2 роки тому +15

    Plz cover LCA using binary lifting too in this course🙏💜

  • @animalsfightingclub5051
    @animalsfightingclub5051 2 роки тому +1

    Very nice

  • @SurajKumar-ml2vb
    @SurajKumar-ml2vb 2 роки тому +1

    awesome bro

  • @abhishekanand5078
    @abhishekanand5078 2 роки тому

    Love you bahiya💛💛💛

  • @someshbhandare
    @someshbhandare 2 роки тому

    Awesome 💛

  • @amanullahkhan929
    @amanullahkhan929 2 роки тому

    very nice explanation

  • @kartikkalani8439
    @kartikkalani8439 Рік тому

    Thank you 🙏

  • @ani68
    @ani68 2 роки тому

    Teaching op...💛💛

  • @yuvrajagarkar8764
    @yuvrajagarkar8764 Рік тому

    vector graph2[N]; will this line create graph2 as an array of vector ?, if so than will graph2 have all elements as empty vector initially ?

  • @satanshuag
    @satanshuag 2 роки тому +1

    Thankyou!

  • @jaykumarpatel6392
    @jaykumarpatel6392 8 місяців тому

    love your videos

  • @ratib4733
    @ratib4733 2 роки тому

    nice ep number :)

  • @freeandreliablejeeprep820
    @freeandreliablejeeprep820 Рік тому

    thank you sir

  • @PankajSaini-ro5yp
    @PankajSaini-ro5yp 2 роки тому

    Tq So much Bhai ❤️

  • @iamdj8540
    @iamdj8540 2 роки тому

    yellow heart
    ye lo heart........lol
    thanx for this video bro after lots of searching i got this excelent video
    u got a nice talent of teaching bro

  • @singh.aadarsh
    @singh.aadarsh 2 роки тому

    Amazing toda aur visualisation kro bhai. Adjacency matrix pair of int , int visualise ni ho paya..
    💛💛💛

  • @rohitchand3853
    @rohitchand3853 Рік тому

    Very underrated 🥺

  • @chiraggoyal9646
    @chiraggoyal9646 2 роки тому +1

    Thanx bhaiya

  • @abcefg7045
    @abcefg7045 2 роки тому +1

    17:08 we will create another list and store the weight there with the correct index number or we can also create map and store them, but creating vector or will be more efficient than maps or unordered maps i guess cuz we need extra space to store the index
    SIR PLEASE REPLY AND SAY WEATHER I AM CORRECT OR NOT ???????

  • @magic.pencil2.0
    @magic.pencil2.0 2 роки тому

    Bhaiya plz make other videos also
    Ur videos very helpful 🧡

  • @pushpakchulet
    @pushpakchulet Рік тому +1

    We can store pair like vector graph2[N] and store as graph[v1].push_back(make_pair(v2,wt)); graph[v2].push_back(make_pair(v1,wt))

  • @srishtygoyal3675
    @srishtygoyal3675 2 роки тому

    WATCHED TILL END💛💛💛💛

  • @JambulaPavan
    @JambulaPavan 27 днів тому

    💛💛💛💛💛💛💛💛 luv u luv sirrrr

  • @its_joel7324
    @its_joel7324 2 роки тому

    @Luv Bro can you tell me how to print the output for the code explained... which I mean to print all that vertices and edges, their connections and if weights are provided and weights too..

  • @iSubhoo
    @iSubhoo 2 роки тому

    Sir, 💛💛💛 for you.

  • @ashz6744
    @ashz6744 2 роки тому

    Nice

  • @shwetasingh5405
    @shwetasingh5405 2 роки тому

    op 🔥🔥

  • @SaumitraAgrawalB22AI054
    @SaumitraAgrawalB22AI054 21 день тому

    i have a doubt ki if i would push 2 or more vertices,weights pair in any index of vector, wont it be overwritten or it would store it like a list in the index?

  • @nishantsharma1042
    @nishantsharma1042 2 роки тому

    💛 completed

  • @ayushKumar-9835
    @ayushKumar-9835 5 місяців тому

    Need little correction there:
    vectoradjList(vertices);

  • @soumojitsur5891
    @soumojitsur5891 2 роки тому

    💛💛
    we can also do this using vector...... the list representation

  • @Ayush479
    @Ayush479 2 роки тому +2

    🔥🔥

  • @accio1107
    @accio1107 2 роки тому

    Can you please tell or share a link of code as to how to implement graph using adj list with weights in JAVA?? (Looking at the video, which was in c++, I tried using ArrayList in Java aswell....but it says its syntactically incorrect that way. ) Kindly help me out !!

  • @holly1190
    @holly1190 2 роки тому

    Bhaiya Graphs pura complete karaiye..plz love ur content!!!

  • @19abhishekgupt70
    @19abhishekgupt70 2 роки тому

    nice

  • @jaydeep-p
    @jaydeep-p 2 роки тому

    Why don't we use an array of unordered_set? Those should be faster than vectors right?

  • @vasugolakiya5093
    @vasugolakiya5093 2 роки тому +1

    💛!!

  • @utsavupadhyay1797
    @utsavupadhyay1797 Рік тому

    pair of vertex and weight stored in index of array i.e., graph2[v1].push_back(make_pair(v2,wt)); graph2[v2].push_back(make_pair(v1,wt)); Ye bhi kr skte??

  • @nishcurse
    @nishcurse 4 місяці тому

    kisiki video mein comment nhi karta but for luv don 💛

  • @Nirajyadav-wu2fi
    @Nirajyadav-wu2fi Рік тому +1

    1st day watched 3 lec

  • @rahulkadam6655
    @rahulkadam6655 2 роки тому +1

    🔥🔥🔥🔝