Overview Memory management is the process of controlling and coordinating computer memory, assigning portions (blocks) to various running programs to optimize overall system performance. Core Concepts The Stack: Stores local variables and function call frames. Fast access, automatic allocation/deallocation. Limited size (can lead to Stack Overflow). The Heap: Stores objects, arrays, and dynamically allocated memory.…
Overview While often used interchangeably, concurrency and parallelism are different. Concurrency is about dealing with many things at once (structure), while Parallelism is about doing many things at once (execution). Core Concepts Process vs. Thread: Process: An independent program with its own memory space. Thread: A “lightweight” unit of execution within a process; threads share…
Overview Time complexity is a theoretical measure that describes the amount of computer time it takes to run an algorithm as a function of the length of the input. Instead of measuring actual seconds (which vary by hardware), time complexity counts the number of elementary operations performed. Core Concepts Elementary Operations: Operations that take a…
Overview Sorting is the process of arranging a collection of data in a specific order (ascending or descending). Efficient sorting is fundamental to many other algorithms, such as Binary Search. Core Concepts Stability: A sort is stable if it preserves the relative order of records with equal keys. In-Place: An algorithm is in-place if it…
Overview Search algorithms are methods used to retrieve information stored within some data structure. The efficiency of a search depends heavily on how the data is organized. Core Concepts Linear Search: Checks every element in sequence. Works on unsorted data. Time: $O(n)$. Binary Search: Repeatedly divides a sorted search interval in half. Works only on…
Overview Big O notation is a mathematical notation used to describe the limiting behavior of a function when the argument tends towards a particular value or infinity. In computer science, it is used to classify algorithms according to how their run time or space requirements grow as the input size ($n$) grows. Core Concepts Time…
Overview A Stack is a linear data structure that follows the LIFO (Last-In, First-Out) principle. The last element added to the stack is the first one to be removed. Think of it like a stack of physical plates. Core Concepts Push: Adding an element to the top of the stack. Pop: Removing the top element…
Overview A Queue is a linear data structure that follows the FIFO (First-In, First-Out) principle. The first element added to the queue is the first one to be removed. Think of it like a line of people waiting for a bus. Core Concepts Enqueue: Adding an element to the end (rear) of the queue. Dequeue:…
Overview A Linked List is a linear collection of data elements called nodes, where each node contains a data field and a reference (link) to the next node in the sequence. Unlike arrays, linked lists are not stored in contiguous memory locations. Core Concepts Node: The basic building block. Contains data and a next pointer.…
Overview A Hash Table (or Hash Map/Dictionary) is a data structure that maps keys to values using a hash function. It allows for extremely fast data retrieval by converting a key into an index in an underlying array. Core Concepts Hash Function: An algorithm that takes an input (key) and returns a fixed-size integer (hash),…