Introduction

Introduction

Data structures and algorithms define a good software developer. This is because they increase one's problem-solving abilities. As such, it is crucial that one thoroughly understands them.

What is a Data structure?
A data structure is simply a way of organizing and managing information in computer memory. This could take any form i.e arrays, linked lists, stacks, queues, graphs e.t.c.

Need for Data structures
Imagine this: you have a list of 100 unique names. How would you store the names such that is easy to find a randomly selected name from the list? You would probably store the names in alphabetical order. This applies to applications. As applications get more complicated and the volume of data increases, issues with information processing and retrieval arise. However, with appropriate data structures, information may be conveniently and efficiently processed and retrieved.

Types of Data Structures

  1. Linear data structures: Elements are organized sequentially one after the other i.e. Arrays, Queues, Lists, Stacks e.t.c.
  2. Non-linear data structures: Elements are in no particular order i.e. graph and tree data structures.

DSA1.png

What is an Algorithm?
An algorithm is a set of well-designed steps to solve a problem. For instance, an algorithm to multiply two numbers could be:

  1. Take the two numbers as inputs

  2. Multiply the numbers using the * operator

  3. Return results

Below are some common algorithms:

  1. Binary-Search Algorithm
  2. Depth First Search (DFS) Algorithm
  3. Breadth-First Search (BFS) Algorithm
  4. Selection Sort, Insertion Sort, Merge Sort, Counting Sort, Quicksort, Heap Sort
  5. Kruskal’s Algorithm
  6. Dijkstra’s Algorithm