Algorithm
o Example: A recipe that tells you exactly how to bake a cake, one step at a time.
Algorithm
Data Types
o Example: Integers (e.g., 1, 2, 3) are data types that represent whole numbers.
Data Types
Data Structure
o Example: Arrays, Linked Lists, Stacks, and Queues.
Data Structure
4. Abstract Data Types (ADT)
o Example: A stack can be represented with an array or linked list, but as an ADT, you only care about operations like push, pop, and peek.
4. Abstract Data Types (ADT)
Linear Data Structure
Non-Linear Data Structure
o Best Case: Minimum time an algorithm takes to complete.
o Worst Case: Maximum time an algorithm takes to complete.
o Average Case: The expected running time across all possible inputs.
Time Complexity
ENUMERATE THE COMMON CASES IN TIME COMPLEXITY AND DIFFERENTIATE THEM
o Best Case: Minimum time an algorithm takes to complete.
o Worst Case: Maximum time an algorithm takes to complete.
o Average Case: The expected running time across all possible inputs.
o Example: If an algorithm needs to store additional arrays or temporary variables, its space complexity increases.
Space Complexity
o Example: If an algorithm needs to store additional arrays or temporary variables, its space complexity increases.
Space Complexity
Asymptotic Notation
ENUMERATE THE COMMON NOTATIONS AND DIFFERENTIATE THEM
o Big O (O): Describes the worst-case scenario.
o Omega (Ω): Describes the best-case scenario.
o Theta (Θ): Describes the average-case scenario.
Sequential Access
Accessing Elements in an Array
ADVANTAGES OF ARRAYS
DISADVANTAGES OF ARRAYS
Multidimensional Arrays
Multidimensional Arrays
Arrays as Lists
Relationship Between Values and Indexes
While arrays hold elements in an ordered sequence, there may or may not be any inherent relationship between the value of an element and its position in the array. This depends on how the array is being used.