03. Graph Data Structure | Creating Adjacency List in C++ | Coding Blocks

  Рет қаралды 81,916

Coding Blocks

Coding Blocks

Күн бұрын

Пікірлер: 98
@shivamagarawal8236
@shivamagarawal8236 3 жыл бұрын
Can't thank you enough... I was always scared of graphs idk why let alone implementing it in C++....these videos has helped me alot to overcome that fear and now I am really comfortable with graphs...even solved a few problems on leetcode on my own.
@bsethupathi1
@bsethupathi1 4 жыл бұрын
This video saved my life. I was breaking my head to learn graphs for a long time. Thanx Prateek. You are awesome! Prateek OP!!
@CodingBlocksIndia
@CodingBlocksIndia 4 жыл бұрын
Happy to help
@peleboykulot6596
@peleboykulot6596 2 жыл бұрын
Thanks a lot!!! Im really struggling to learn graphs for a week and you just taught me graph in 8min. Dude create more tutorial like this!
@dev_casper
@dev_casper 2 ай бұрын
Thanks! Helped me understand the basics of a graph.
@abhi6853
@abhi6853 3 жыл бұрын
search for this kind of video form 3 days.finally got it. Thanks
@BloodFang-j5u
@BloodFang-j5u 3 ай бұрын
your explaination is very good,loved it
@vaibhavpallod1023
@vaibhavpallod1023 3 жыл бұрын
wrong method of initialisation list is always dynamic so how can u initialise it again with new list .... ?????????????
@arunlabana5937
@arunlabana5937 3 жыл бұрын
Got it. But I came here to store not only vertices and edges. I thought you will also expalin how to store weights on every edge.
@SatnamSingh-sk3hd
@SatnamSingh-sk3hd 3 жыл бұрын
when someone try to solve graph's questions, he/she don't understand the structure of graph how it will be represent apart from dfs/bfs a student havnt idea about only the traversal. in the tutorials everywhere everyone only told how to traverse the graph bfs/dfs none of the tutorials told about the adjacency list, what is that how to acces data from it, how to traverse adjacency list, when we know about the adjacency list automatically we can understand the graph. thanks man
@geovanyteca3250
@geovanyteca3250 3 жыл бұрын
a very simple explanation of a complex concept, great video !!!
@sanket7877
@sanket7877 Жыл бұрын
Thanks a lot sir for this video. You explained the code in a simple and easy manner.
@KaranDhingra
@KaranDhingra 3 жыл бұрын
Loved this
@shaheenrafiq5974
@shaheenrafiq5974 3 жыл бұрын
Thank you so much for walking through the entire code. Helped a lot. Also thanks for doing it in English :)
@kausachan4167
@kausachan4167 3 жыл бұрын
what if we had A,B,C,D.... as vertices how willl be index and store?
@kapil1024IT
@kapil1024IT 2 жыл бұрын
again, very clear and concise
@AmitSingh-cs2hb
@AmitSingh-cs2hb 4 жыл бұрын
Nice explanations sir👏🏻👏🏻
@gamingfingers4523
@gamingfingers4523 3 жыл бұрын
Feels a bit complicated to a beginner. Vector of an array would have been easier or even vector of Vector.
@ankitwankhede2982
@ankitwankhede2982 3 жыл бұрын
Lists are much more efficient while deleting or adding vertices
@memeswallah5253
@memeswallah5253 2 жыл бұрын
Sir for adjacency elements for loop syntax samaj ni aaya For(int x:adj[v]){ Cout
@important8026
@important8026 Жыл бұрын
Thank you ❤
@dadyking1210
@dadyking1210 3 жыл бұрын
Very good tutorial! Thank you
@namangupta9582
@namangupta9582 4 жыл бұрын
Thankyou very much bhaiya it really helps me a lot.
@tombrady7390
@tombrady7390 3 жыл бұрын
he teaches nicely peopleonly are not paying attention then they blame him that he is teaching like reading a book.
@vamshisamineniz5905
@vamshisamineniz5905 4 жыл бұрын
vedio is very concise
@Hassassin56
@Hassassin56 3 жыл бұрын
Thank you co much !
@enjaee
@enjaee 3 жыл бұрын
thank you for this video
@paula19335
@paula19335 2 жыл бұрын
You have no idea how happy you made me... I thought I will never understand graphs😅
@zakridouh
@zakridouh 3 жыл бұрын
Why not use a hashmap for storing the adjacency list?
@ahanmr7547
@ahanmr7547 4 жыл бұрын
Can be use array of vectors for creating adjacency lists?
@ketanahuja8939
@ketanahuja8939 4 жыл бұрын
yeahsure
@exodus5948
@exodus5948 4 жыл бұрын
@@ketanahuja8939 vector adjList[]
@anjalialmale8018
@anjalialmale8018 3 жыл бұрын
Good one. But how u write....during coding ...at right side how u explain ...means which method u have used for making video.. please tell
@uzmaahmed6547
@uzmaahmed6547 4 жыл бұрын
Will you be able to show in C# please!
@saikun0293
@saikun0293 4 жыл бұрын
very useful video thanks!
@CodingBlocksIndia
@CodingBlocksIndia 4 жыл бұрын
Glad it was helpful!
@ironclock
@ironclock 3 жыл бұрын
How would you go about searching through this?
@anameekasaraf3332
@anameekasaraf3332 2 жыл бұрын
Sir the push_back function is not working, what should I do? I tried all ways to solve the error but all in vain. Kindly help.
@tanvir_rishad11
@tanvir_rishad11 10 ай бұрын
why you wrote Graph g(4) instead of Graph g=new Graph(4) will you kindly explain me
@ishanrajpal5975
@ishanrajpal5975 3 жыл бұрын
Can anyone tell how to take user input for every vertex?
@bawavikram1113
@bawavikram1113 4 жыл бұрын
in addEdge function, what if value of a vertex is 1000 and other verteces are 0 , 1, 2. Then size of list will be 1000. Its waste of memory. Please clarify my confusion. Thanks in advance
@gsb22
@gsb22 4 жыл бұрын
If there are 1000 vertices(nodes) and here we are assuming that graph is connected, that means each node will have atleast one neighbour which we will store at node's position list. Here 1000 would be length of main array, but lists at every index of that array wont be that long.
@atifjalal3046
@atifjalal3046 4 жыл бұрын
Sir.....small doubt...I have studied everywhere that we cannot use sub-script operator with list...then how u are using this.......I m not understanding....🙄
@ethicalitle9770
@ethicalitle9770 4 жыл бұрын
www.cplusplus.com/reference/list/list/ you can also implement your own linked list if you want to, but c++ already has a list container in its standard library, its a doubly linked list
@jokadim
@jokadim 3 жыл бұрын
I use Dev C++5.11 and i read the comment and change the complier to c++14 but when i run it i get no results. even if the programm ends with a 0, it prints nothing. Is there anything else to do? Thank you.
@jokadim
@jokadim 3 жыл бұрын
ok somebody answered this. Thank you.
@mrkunalgoswami2010
@mrkunalgoswami2010 4 жыл бұрын
Can u take edges from user ... ??
@ethicalitle9770
@ethicalitle9770 4 жыл бұрын
Yes you can
@mrkunalgoswami2010
@mrkunalgoswami2010 4 жыл бұрын
@@ethicalitle9770 PLZ code one with full explanation of each line. Also make using adjacency list. Sir u will get some view, we will get knowledge.
@ethicalitle9770
@ethicalitle9770 4 жыл бұрын
@@mrkunalgoswami2010 Copy the code from the video except the main function. Copy the main function I have written below and paste it into your code. I have added a comment in each line so you can understand properly: int main(){ int v,e; // These will be used to take number of vertices and edges as input cout > v; Graph g(v);//A graph has been initialized with v vertices cout > e; // Now we take in "e" number of edges //We have to loop e times, take the edges' x and y as input and make the edges int x,y; for(int i = 1; i y; g.addEdge(x,y); } g.printAdjList(); // Now it will print all the edges return 0; }
@mrkunalgoswami2010
@mrkunalgoswami2010 4 жыл бұрын
@@ethicalitle9770 sir i am going to do today
@mrkunalgoswami2010
@mrkunalgoswami2010 4 жыл бұрын
@@ethicalitle9770 Sir i think g.printAdjEdge()
@hadeedfatema3639
@hadeedfatema3639 3 жыл бұрын
i ddin't get point, for (int nbr:l[i]) ; also my compiler is giving error on this can you please help me resolving this?
@ritik5604
@ritik5604 3 жыл бұрын
Switch your compiler version to C++ 14 . That's why you are facing an error
@BhagyaRana
@BhagyaRana 4 жыл бұрын
Prateek Bhaiya, You forgot to add One Line of Code to call the Print AdjList g.printAdjList();
@DenzelOden
@DenzelOden 4 жыл бұрын
I was thinking the same thing, he added it but in the video you can notice a quick cut that jumps past where he added that and the semicolon at the end of 7:02
@simplifycs8753
@simplifycs8753 2 жыл бұрын
Hi Bhagya pls checkout this explanation kzbin.info/www/bejne/pHKXmKmgmNRngas
@newos
@newos 2 жыл бұрын
I m getting error on push back
@baxi9227
@baxi9227 4 жыл бұрын
why create a class? Can't I make everything every time I want to use it? Is it that hard?
@cristieandino3991
@cristieandino3991 3 жыл бұрын
Can you help me in my project?
@ashirbadbehera5544
@ashirbadbehera5544 4 жыл бұрын
why we use this->v = v instead we can't we write this.v = v
@AmitSingh-cs2hb
@AmitSingh-cs2hb 4 жыл бұрын
'this' is a pointer not a object
@faang1485
@faang1485 4 жыл бұрын
When we use same variable then we have to use this pointer to distinguish between same named variable
@shubhambarnwal3387
@shubhambarnwal3387 4 жыл бұрын
Sir i want to take input by user ....Plz check i just edited the main function and remaining code is same ....What is the mistake ???Please comment int main() { int V,E,x,y; cout > V; cout >E ; Graph g(V); for(int i=0;i> y ; g.addEdge(x,y); } }
@Folderq
@Folderq 3 жыл бұрын
I don't want to be a jerk, however how is it possible You are "Teaching" C++, while You can't go along with english. I hate thoose videos about advanced things and I absolutely can't understand person who's trying to explain, because I got a feeling I need another person who translate from "dis inglis" to "english". I have absolutely no idea what are You talking about... If some1 would change video name to "How to cook a soup" I wouldn't see any difference.
@ahmedawwad7820
@ahmedawwad7820 3 жыл бұрын
Thank you ,bro
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 78 МЛН
快乐总是短暂的!😂 #搞笑夫妻 #爱美食爱生活 #搞笑达人
00:14
朱大帅and依美姐
Рет қаралды 14 МЛН
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 837 М.
Learn Graphs in 5 minutes 🌐
5:17
Bro Code
Рет қаралды 138 М.
Store Graph And Tree In vector of vector
11:19
CppNuts
Рет қаралды 9 М.
GRAPH Data Structure | What is Graph? | DSA Course | GeeksforGeeks
14:51
Queue Data Structure In STL | C++ Tutorial
18:44
Portfolio Courses
Рет қаралды 16 М.
Hash Tables and Hash Functions
13:56
Computer Science Lessons
Рет қаралды 1,6 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 78 МЛН