Skip to content

Latest commit

 

History

History
72 lines (54 loc) · 1.35 KB

DataStructures.md

File metadata and controls

72 lines (54 loc) · 1.35 KB

Data Structures and Algorithm

My note

What makes a good algorithm

  1. Correctness
  2. Efficiency

Data Structure: How to organize Algorithm: How to fetch data

Types Of Data Structures

  1. Primitive Data structures
    • Integer
    • Float
    • Float
    • Character
    • String
    • Boolean
  2. Non-Primitive Data Structures
    • Linear
    • Static
    1. Array
      • Dynamic
    2. Linked List
    3. Stack
    4. Queue
      • Non Linear
        • Tree
        • Graph

Types of Algorithm

  1. Simple recursive
  2. Divide and conquer
  3. Dynamic programming
  4. Greedy
  5. Brute force
  6. Randomized

Area of focus in algorithms

  1. Sorting
  2. Dynamic Programming
  3. BFS + DFS (Searching)
  4. Recursion

CPU - Runs the application RAM - You loose data when you power off the computer Storage - Data is persistent

Data Structure

A data structure is an arrangement of data that is used to represent a particular problem.

Array

The reason why we use array to look up data or for most data structures is that it is very fast and we already know the position of the data.

[x] lookup O(1) [x] insert O(n) [x] delete O(n) [x] push O(1) [x] pop O(1)

Optional Classes in Javascript

  • Reference Type
  • Context 'This is often confused with scope' 'Scope is created with a curly brace'
  • Instantiation 'Creating an object'