Data Structure and Algorithms – An Overview

T. H. Cormen, Ed., Introduction to algorithms, 2nd. ed., 10th pr. Cambridge, Mass.: MIT Press [u.a.], 2007.

Data Structure and Algorithsm, Sixth Edition, GoodRich et al., Wiley

What is a data structure? https://www.ibm.com/think/topics/data-structure

What are algorithms?

An Algorithm is simply a specific, step-by-step set of instructions used to complete a task or solve a problem.

In the context of Computer Science (DSA), if a Data Structure is how you organize and store data (like a bookshelf), the Algorithm is the procedure you use to interact with that data (like the steps to find a specific book on that shelf).

An algorithm is like an recipe. With input, we have ingredients such as data in numbers, text or lists etc. We follow a sequence of well defined operations on that data such as cooking instructions (Process). Through those processes, we get output (the meal) like sorted list, specific value or yes/no etc.

Data Structures:

These are the containers used to store and organize data.
https://en.wikipedia.org/wiki/Data_structure

Non-Linear Data Structures:

Data elements are arranged hierarchically or interconnectedly.

Algorithms:

These are the procedures to process the data.

  • Sorting Algorithms
    • Simple/Slow: Bubble Sort, Insertion Sort, Selection Sort.
    • Efficient/Fast: Merge Sort, Quick Sort, Heap Sort.
    • Non-Comparison: Radix Sort, Counting Sort, Bucket Sort.
  • Searching Algorithms
    • Linear Search: Check every element one by one.
    • Binary Search: Divide and conquer on sorted data.
  • Graph Algorithms
    • Traversal:
      • Breadth-First Search (BFS): Explore neighbor by neighbor (layer wise).
      • Depth-First Search (DFS): Go as deep as possible before backtracking.
    • Shortest Path:
      • Dijkstra’s Algorithm: Shortest path in weighted graphs (no negative weights).
      • Bellman-Ford Algorithm: Handles negative weights.
      • Floyd-Warshall Algorithm: All-pairs shortest path.
      • A* Search: Used in pathfinding (like video games/maps).
    • Minimum Spanning Tree (MST):
      • Kruskal’s Algorithm
      • Prim’s Algorithm
    • Others: Topological Sort, Flood Fill, Lee Algorithm.
  • String Algorithms
    • KMP Algorithm (Knuth-Morris-Pratt): Fast pattern matching.
    • Rabin-Karp Algorithm: Rolling hash pattern matching.
    • Z Algorithm / Manacher’s Algorithm: Advanced string manipulation.
  • Algorithm Paradigms (Strategies)
    These are “styles” of solving problems, not specific algorithms themselves.
    • Recursion: A function calling itself.
    • Divide and Conquer: Break a problem into smaller sub-problems (e.g., Merge Sort).
    • Dynamic Programming (DP): Solve complex problems by breaking them down and storing the results of sub-problems to avoid re-computation (e.g., Fibonacci, Knapsack Problem).
    • Greedy Algorithms: Make the locally optimal choice at each step (e.g., Huffman Coding).
    • Backtracking: Explore all possibilities and “backtrack” when a path fails (e.g., Sudoku solver, N-Queens problem).

Leave a Reply

Your email address will not be published. Required fields are marked *

error: