Tag: memory


  • 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 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.…

  • Array

    Overview An array is a linear data structure that collects multiple elements of the same type (usually) stored in contiguous memory locations. Elements are accessed using a numerical index. Core Concepts Indexing: Most languages use zero-based indexing, where the first element is at index 0. Contiguous Memory: Elements are stored side-by-side in memory, allowing for…

  • Overview A variable is a symbolic name (identifier) that refers to a value stored in the computer’s memory. Unlike constants, the value held by a variable can be changed (mutated) during program execution. Core Concepts Declaration: Informing the compiler/interpreter that a variable exists (e.g., let x;). Initialization: Assigning an initial value to a variable (e.g.,…

  • Overview Scope determines the visibility and lifetime of variables and functions in different parts of a program. It defines where an identifier can be accessed and where it is hidden from other parts of the code. Core Concepts Global Scope: Variables declared outside any function or block. They are accessible from anywhere in the program.…

  • Overview Immutability is the state of an object or value that cannot be modified after it is created. Instead of changing the existing data, any operation that would modify the value must create a new copy of the data with the changes applied. Core Concepts Mutable vs. Immutable: Mutable: The object can be changed in…

  • Overview Data types are classifications that tell the compiler or interpreter how the programmer intends to use the data. They determine what values a variable can hold and what operations can be performed on that data. Core Concepts Primitive Types: The most basic data types built into a language. They are usually stored by value.…

  • Overview A constant is an identifier for a value that cannot be modified during the execution of a program. Once a constant is assigned a value, that value remains fixed. Core Concepts Immutability: The core property of a constant; it prevents accidental changes to data that should remain static. Naming Conventions: Often written in SCREAMING_SNAKE_CASE…