Jordan Taylor
justjordant

justjordant

Day 1  - What are Data Structures and Algorithms

Day 1 - What are Data Structures and Algorithms

Jordan Taylor's photo
Jordan Taylor
·Aug 23, 2022·

2 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

Table of contents

  • Data Structures
  • Algorithms
  • Resources

We tend to use Data structures & Algorithms every day unintentionally, from using GPS for sorting our mail to even cooking our favorite meals.

Data Structures

pic

I like to think of data structures like boxes that we can use while programming and ways that we can organize our data in a more usable from a computing standpoint.

Data structures are a big topic in computer science; there are many different structures that we have at our fingertips. Does this mean we should just use them all?

gif

Not quite, data structures and algorithms can be thought of like tools; given a job, a hammer might not be the best tool for the job.

iu.jpg

Finding the right tool for the job is what we are looking trying to do, getting the job done in the most efficient way possible.

Algorithms

Now when looking at algorithms, these are the instructions for our tools and how we tell our program to use the tools that we are providing it.

879AEA25-0CE2-40E4-B424-9992C38F4BE8.png

Algorithms provide the set of instructions for our program; take a look at our following program we have a simple class Math with two methods; reading over this, we can see for our inputs we are taking in 2 numbers n1, n2 and out program has instructions for these inputs.

public class Math
{
   public int Add(int n1, int n2)
   {
      return n1 + n2
   }

   public int Subtract(int n1, int n2)
   {
      return n1 - n2 
   } 
}

As always, happy coding, my friends! 😊

Resources

10 Algorithm Examples Used In Your Daily Life

List of data structures - Wikipedia

Data structure - Wikipedia

Did you find this article valuable?

Support Jordan Taylor by becoming a sponsor. Any amount is appreciated!

See recent sponsors Learn more about Hashnode Sponsors
 
Share this