Data structures and algorithms (Intro)
5 min read
Hey! Thanks for coming to this corner.
Who is this for?
- Computer science undergraduate looking to learn data structures.
- Developers who want to understand data structures.
1.Why study Data structures?
Data and types of data.
What are data structures?
Types of data structures and their examples.
What is an algorithm?
Let's get right in.
Why study Data Structures?
Data structures are what makes storing, accessing and retrieving data in everyday computing efficient. It is important for every developer to have a knowledge of it as we deal with data directly or indirectly.
Before proceeding to what data structures are, let us consider what data is and the types of data.
Data is simply unprocessed facts and figures. The only become useful when they undergo processing that is needed. What are the types of data that exist?
- built-in or primitive data types(we would be referring to this as primitive).
- Abstract data types.
Primitive data types are provided by the programming language. They often serve as the building block. They include:
- floating point numbers(for decimals)
- Char(specific to some languages like C and Java)
- Booleans(True and False) In languages like Java and C(Forgive me, I might be referring to them a lot throughout this series), Double(for two or decimal points).
Abstract data types.
Abstract data types or (ADT for short) is a data type that gives information about the types of operations to be performed on it but not how it should be performed.
Examples of ADTs.
Abstract data types are sometimes confused with data structures, but the main difference is that data structures are used to implement abstract data types(ADT). Just keep that at the back of your mind, it would get clearer as we progress. Hang on!
What are data structures?
There are tons of definitions of data structures on the internet. These definitions are only expressed in different terms but they mean the same thing.
Data structures are logical ways or models for organizing data in the computer memory.
They make it easy to store and access data. The usage and purpose of the data will determine the data structure to be used.
Types of data structures.
There are two types of data structures.
- Linear - Arranged in linear format(
Examples: Arrays and Linked list.
- Non-linear - Arranged in a non-linear format
Examples: Trees, Graphs.
These two types of data structures can also fall into two categories:
- Static : Memory is allocated at compile time i.e before execution of the program.
- Dynamic: Memory is allocated at runtime i.e during the execution of the program.
List of data structures.
- Linked list.
These are some of the most popular data structures. Other complex ones are usually an implementation of one data structure to perform a task e.g Hash tables, binary trees, hash trees etc.
An algorithm is a step by step procedure to solve a specific problem. In computing, there are various types of algorithms and they differ in their applications. I wrote about algorithms as a aid for problem solving here.
In the coming articles of this series, we would focus more on language agnostic concepts that are useful in data structures and algorithms.
If you find this article helpful, please let me know. You can also shoot me a DM on Twitter .