Introduction - DSA #01
What is Data Structure?
In Abstract Data Type is a mathematical model with a collection of operations defined on that model, and with no implementation details.
or
An Abstract Data Type is the specification of a data in some language, independent of an implementation.
Examples are Integer, Array, List, Map, Queue etc.
Real Life Example: A book is an abstract. It doesn't tell us anything about itself. We can't figure out whether it is a story book, a text book or a telephone book. Where a Telephone book is an implementation. Because now we know that it is a telephone book and what and what kind of content is in it.
Detailed Examples:
let's assume we have a C++ file containing the following code.
int x = 34;
As you can see, we don't need the implementation of this datatype because its an abstract datatype. Now, let's move on to the Data Structure.
What is a Data Structure?
Data Structure is simply the implementation of ADT (Abstract Data Type). Now, you might be thinking that how the integer data type is gonna be implemented?. The answer is we will use those int or any other ADT to build our own Data Structure. If you have worked with OOP (Object Oriented Programming), you might have the idea already.
Data Structures are used to store data in a computer in an organized fashion. We structure our data as we want. So, we can access it easily.
Example:
Arrays, Stacks, Queues, Linked Lists, Trees, Graphs, Hash Tables etc.
Now let's move on to the Big-O...



No comments:
Thanks For Your Comment!