Basics of ds | Sololearn: Learn to code for FREE!

+4

Basics of ds

What is difference between data structure and standard template library ? Can we call vector as data structure ? One more question is related to tree and graph. When to choose what among these two ? Any real time example would be more useful to understand.

1/28/2020 9:11:28 PM

Ketan Lalcheta

5 Answers

New Answer

+3

https://www.sololearn.com/learn/773/?ref=app https://www.sololearn.com/learn/656/?ref=app https://www.sololearn.com/learn/322/?ref=app https://www.sololearn.com/learn/13851/?ref=app https://www.sololearn.com/learn/13672/?ref=app https://www.sololearn.com/learn/13668/?ref=app

+3

For example of graph, please expand the comments of that graph lesson, you can find examples of Java, C++, C# and Python. For your first question, Data Structure is the concept, it applies to all programming language. Standard Template Library is the implementation in C++ to speed up production. In later language, many data structure such as Hash Map is built-in (Python's Dictionary, JavaScript's Object). Tree, in Mathematics' Graph Theory, is a kind of Graph. In programming, Tree has many different types, each type has its different usage. You can expand the comment section of each Tree lesson to see some examples.

+2

Thanks Gordon .. this answers my second question. Any other example of graph usage ? I am not able to think about another example for tree on my own. Additionally , my first question still confuses me that what's difference between stl and ds.

+2

I would call a vector a data structure.

+2

If you're modelling the collection of members and their links in a social network, you would use a graph and not a tree.