DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 963,864 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Catherine Kawara
Catherine Kawara

Posted on

Data Structures 101: Introduction to Data Structures and Algorithms.

A data structure is a particular way of organizing data in a computer so that it can be used effectively.As developers, we must have good knowledge about data structures as it is a key topic when it comes to Software Engineering interview questions.
The most commonly used data structures include;

  1. Arrays
  2. Linked lists
  3. Stack
  4. Queues

Algorithms

An Algorithm is a step-by-step procedure, which defines a set of instructions to be executed in a certain order to get the desired output. They are normally independent of any programming language, as they can be implemented in more than one programming language.

Characteristics of a good algorithm

  1. Input βˆ’ should have 0 or more well-defined inputs.
  2. Output βˆ’should have 1 or more well-defined outputs, and should match the desired output.
  3. Finiteness βˆ’ they must terminate after a finite number of steps.
  4. Feasibility βˆ’ Should be feasible with the available resources.
  5. Independent βˆ’ should be independent of any programming code.
  6. Unambiguous βˆ’ Each of its steps, and their inputs/outputs should be clear and must lead to only one meaning.

Example of an algorithm

Algorithms are mostly writen in a step by step manner. For example, an algorithm to ad two numbers would look something like this

Step 1: Start
Step 2: Declare variables num1, num2 and sum.
Step 3: Read values for num1 and num2.
Step 4: Add num1 and num2 and assign the result to sum.
sum=num1+num2
Step 5: Display sum
Step 6: Stop
Enter fullscreen mode Exit fullscreen mode

That is the basic introduction to algorithms, of course this is a much deeper topic which we will continue to explore. Till next time, happy coding✌!

Top comments (1)

Collapse
 
dyarawilliams profile image
D'yara Williams

I've always found DSA very interesting... great intro article.

Take a look at this:

Settings

Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. πŸ›