Introduction to Data Structures for Beginners!

Introduction to Data Structures for Beginners!

You may have heard a lot about the word "Data Structures" in your college or maybe from your cousin who is preparing for Microsoft or Google or different FAANG companies.

I heard this word when I was in the College's second year of my CS course there was a subject "Data Structures with C". At first, I was like um yeah it's just another boring subject needed to pass the exams but I realised later this is really a very powerful, Important and actually very useful subject in the field of Computer Science.

What the hell is even Data Structure?

Let's just start with "Data" first.

What is Data?

A typical google definition would be - Data is a collection of information gathered by observation, measurements... bla bla bla.

Let me explain the term data in easy words well you see Data is just unprocessed information. In other words, Information is Processed Data.

There is a lot and when I say a lot it means trillions and gazillions of bytes of raw data available on the internet which is unstructured and random in nature. From the beginning of time until 2005, the entire world only had about 5 Billion Gigabytes(GB) of data.

The same amount of data was generated over 2 to 5 days in 2011. By 2015 this volume was generated in 10-15 minutes. The amount of data available in the world currently is estimated to be ~100 Zettabytes (2021). (Google yourself what is Zettabytes) and where do we store this data? well, the answer is "Cloud servers".

Why do we need Data Structures?

My point is there is a lot of data being created every single minute and Companies need this data for their business models. and for this, they need to store and organise this data for its potential use.

Programmers learn how to handle this data and manipulate it using "Data Structures". Structures that are made up of data. Data in this sense can be anything from numbers to alphabets, characters, names, phone numbers, strings, or anything else. And we use "Algorithms" to manipulate this stored data.

So, Data structure is nothing but a way to store and organise data so that it becomes easily accessible, easy to manipulate and easy to retrieve later.

Many colleges in India forget to teach the exact reason why we need data structures in real life but now you know.

Now the question arises, How many Data structures are there in the Programming world and What operations do we perform with data (manipulation with data)?

Types of Data Structures

There are mainly 2 types of Data Structures as far as you are concerned with "its structure"

  • Linear data structure - A Linear data structure has data elements connected to each other in a Linear fashion. which means that the data is connected to each other in a sequential manner. One after another and so on connected in a way like for example - A Train full of Passengers in different coaches where each coach of train is like a container full of data elements.
  • Non-Linear data structure - A Non-Linear data structure is the opposite of a Linear data structure which means it has a random or not-so-sequential manner of structure. for example - Tree branches are not so sequential but rather connected in a hierarchical fashion.

Mostly used Linear data structures are the following -

  • Arrays

  • Lists (Arraylists and Linkedlists)

  • Stacks

  • Queues

  • Hashmaps or Hashing tables

The most used Non-Linear data structures are the following -

  • Trees

  • Tries

  • Graphs

What are the operations performed on the Data Structures?

  • Traversing or Traversal means visiting each element one by one of the data structures. (Done using a loop)

  • Searching is done using traversal and we search for a particular element in the data structure until it is found.

  • Insertion is adding an element into the data structure on a particular position.

  • Deletion means removing a particular data element from the data structure.

  • Sorting means arranging the data into some order which can be either Increasing or Decreasing order. (Binary Search loves Sorted data)

  • Merging means that we merge 2 or more data structures into one new data structure. Mostly it is done using an extra data structure which doubles the capacity so that they can merge and fit into the data structure.

What next?

As you can see I have given you an overall idea of what Data Structures actually are in this blog. Now it's your turn to do some googling and start learning Data structures on your own. You can do this easily, there are hundreds of courses online both free and paid through which you can learn easily about Data structures but I would suggest you utilise free resources for the sake of sanity :) just kidding it's your choice.

Why learn data structure? because they make you a better programmer and help you grow your logical thinking, they also increase your chances of cracking the interview coding round because your logical thinking power will be much much higher with the help of Data Structures and Algorithms.

Some of the best resources I know and personally use are following-

Youtube Channels

  • KunalKushwaha

  • Freecodecamp

  • Love Babbar

  • WS Cubetech

  • Codewithharry

Books

  • DS Algo by Y Daniel Liang

  • Grokking Algorithms

  • Intro to Algorithms by Thomas H Cormen

  • Data Structure and Algorithms Made Easy

  • Data structures and Algorithms in Java by Robert Lafore

Websites

  • geeksforgeeks

  • freecodecamp

  • udemy

  • github

  • w3schools

  • hackerrank

Websites to practise Data Structures

  • hackerrank

  • hackerearth

  • leetcode (p)

  • codeforces

  • codechef

Thank you for taking the time to read my blog. I wish you great success in the future. Keep learning. :)

Did you find this article valuable?

Support Shubh's Blog ☕ by becoming a sponsor. Any amount is appreciated!