paint-brush
Fundamentals of Data Structures [Part 1]by@marvin
237 reads

Fundamentals of Data Structures [Part 1]

by MarvinNovember 24th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Fundamentals of Data Structures [Part 1] is a look at what happens to our code in variable assignment. It's a way of organizing data. It's all data in the end. We need a data structure(s) that will allow traversing, insertion, searching, deletion( in case the last casserole was outright nasty), sorting, or merging of bits of data. The how of getting our data and manipulating it from these structures are our algorithms. We'll go into the details soon enough.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Fundamentals of Data Structures [Part 1]
Marvin HackerNoon profile picture

A trip down memory lane avid reader. Let's take a walk through the core of it all: data structures. What are they and why are they so important? A 'hello' to a reader that might have missed our talk on Memory management, where we delved into what happens to our code in variable assignment. Do take a look, even if it's a refresher you're looking for.

Alright then. What is a data structure?

It's a way of organizing data. Say we have a couple of friends coming over for our fortnightly game night( ah...the things on our to-do list). We need snacks, a number of people expected to be there, a list of activities to partake. I can go on and on. So how do we organize this in say a program we want to implement to fix the hustle of planning? How do we store the things to be done or the items to be purchased? It's all data in the end. We need structure. We need data structures. The how of getting our data and manipulating it from these structures are our algorithms.

Right back to our game, who will do what?

How do we decide what comes before what in terms of structuring this data? Does our simple program make it easy to retrieve this information? Is it fast enough? What about efficiency?

Whatever kind of application we are talking about, we need a data structure(s) that will allow traversing, insertion, searching, deletion( in case the last casserole was outright nasty), sorting, or merging of bits of data. Call it CRUD with extra steps.

As from the Memory management article, we got data, then collections of data. It's all data. While memory allocation might not be something we think of with javascript or even Python, it holds water when doing C or C++. So keep this in mind.

Broadly speaking, we group data structures, much like data types in itself, as:

  • Primitive
  • Non-primitive

Primitive structures would hold primitive data types; that is the chars, the int the float. Basically, data types that hold a single value.

Non-primitive structures, on the other hand, break down to linear (which holds data in a sequence) and of course non-linear. Hold your breath in case you lost it a moment there. We'll go into the details soon enough.

As of now, you have a general idea, a scope if you may, of what structures involve.

They are quite a number.

Over the course of the next couple of weeks, we'll be covering some of these structures. Unraveling them to bits and pieces. Finding what makes them tick as so and getting why many a time, developers new and old alike, have challenges addressing them. Stick a while, I cannot wait for our next piece in this!

Previously published at https://thegreencodes.com/the-power-of-data-structures