Algorithms & Data Structures¶
Learning resources for algorithms, data structures, and OOP patterns
Topics¶
-
Pointers
In-depth guide to C/C++ pointers, memory management, and common patterns.
-
Function Pointers
Comparison of function pointers across languages and callback patterns.
-
OOP Patterns
Object-oriented programming patterns with Python examples.
Learning Path¶
flowchart TD
subgraph Fundamentals
A[Variables & Memory] --> B[Pointers]
B --> C[Dynamic Allocation]
end
subgraph Advanced
C --> D[Function Pointers]
D --> E[Callbacks]
E --> F[Design Patterns]
end
subgraph OOP
F --> G[SOLID Principles]
G --> H[Creational Patterns]
H --> I[Structural Patterns]
I --> J[Behavioral Patterns]
end
Concept Overview¶
Memory & Pointers¶
| Concept | Language | Description |
|---|---|---|
| Raw Pointers | C/C++ | Direct memory address manipulation |
| Smart Pointers | C++ | Automatic memory management |
| References | C++/Java | Alias to existing objects |
Design Patterns¶
| Category | Patterns | Use Case |
|---|---|---|
| Creational | Singleton, Factory, Builder | Object creation |
| Structural | Adapter, Decorator, Proxy | Object composition |
| Behavioral | Observer, Strategy, Command | Object interaction |
Quick Reference¶
Pointer Operations (C/C++)¶
int x = 10;
int *ptr = &x; // Pointer to x
int val = *ptr; // Dereference: val = 10
int **pptr = &ptr; // Pointer to pointer
Function Pointer (C)¶
int (*func_ptr)(int, int); // Declaration
func_ptr = &add; // Assignment
int result = func_ptr(3, 4); // Call