Tag: fundamentals


  • Graph

    Overview A Graph is a non-linear data structure consisting of a finite set of vertices (or nodes) and a set of edges that connect pairs of vertices. Graphs are used to represent networks of interconnected objects. Core Concepts Directed vs. Undirected: Directed (Digraph): Edges have a direction (e.g., a Twitter follow). Undirected: Edges have no…

  • Overview A Binary Search Tree (BST) is a node-based binary tree data structure which has the following properties: The left subtree of a node contains only nodes with keys less than the node’s key, and the right subtree contains only nodes with keys greater than the node’s key. Core Concepts Root: The topmost node of…

  • 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 A type system is a logical framework that assigns a “type” (e.g., integer, string, boolean) to the various programs’ components. It is used by compilers and interpreters to ensure that operations are performed on compatible types, preventing a large class of runtime errors. Core Concepts Static vs. Dynamic Typing: Static Typing: Types are associated…

  • 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 Recursion is a programming technique where a function calls itself to solve a problem. It is typically used to solve problems that can be broken down into smaller, identical sub-problems. Core Concepts Base Case: The condition under which the recursion stops. Without a base case, the function would call itself infinitely. Recursive Step: The…

  • Overview Loops are control flow structures that repeat a block of code as long as a specified condition is met. They are essential for processing collections of data or performing repetitive tasks without writing the same code multiple times. Core Concepts Iteration: A single pass through the loop’s body. Loop Types: For Loop: Best when…

  • 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 A function is a reusable block of code designed to perform a specific task. Functions allow programmers to break complex problems into smaller, manageable pieces, reducing redundancy and improving maintainability. Core Concepts Declaration vs. Expression: Declaration: A named function defined in the global or local scope. Expression: A function assigned to a variable (often…