1/73
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No study sessions yet.
Sequence
Instructions executed one after another in a fixed order.
Selection (Branching)
A programming construct that chooses which path to follow based on a condition.
Condition
A Boolean expression that evaluates to TRUE or FALSE.
IF statement
Used in selection to run code only if a condition is TRUE.
Iteration
The process of repeating a block of code.
Loop
A structure that repeats code until a condition is met.
Count-controlled loop
A loop that runs a fixed number of times.
Condition-controlled loop
A loop that continues while a condition is TRUE.
Recursion
A programming technique where a function calls itself.
Base case
The condition that stops a recursive function from calling itself.
Stopping condition
The simplest case where a recursive function returns a result.
How recursion works
The function repeatedly calls itself with smaller inputs until the base case is reached.
Stack overflow
An error caused when a recursive function has no stopping condition and uses too much memory.
Recursion advantage
Code is often shorter and clearer for problems like trees.
Recursion disadvantage
Uses more memory and is harder to debug than iteration.
Iteration advantage
More efficient and easier to understand and debug.
Iteration disadvantage
Can require more code than a recursive solution.
Global variable
A variable declared outside all functions and accessible throughout the program.
Local variable
A variable declared inside a function and only accessible within that function.
Variable scope
The part of a program where a variable can be accessed.
IDE (Integrated Development Environment)
Software that allows programmers to write edit run and debug code in one place.
IDE benefit
Improves efficiency by combining multiple development tools.
Array
An ordered static data structure that stores elements of the same data type.
Static data structure
A data structure with a fixed size.
2D array
An array arranged in rows and columns like a table.
3D array
Multiple 2D arrays arranged together like pages in a spreadsheet.
Record
A data structure made up of fields that store different data types.
Field
An individual piece of data within a record.
List
A dynamic data structure that can store duplicate values.
List memory storage
List elements are stored non-contiguously in memory.
Tuple
An ordered collection of values that is immutable.
Immutable
Data that cannot be changed after it is created.
Linked list
A dynamic data structure made of nodes connected by pointers.
Node
An item in a linked list containing data and a pointer.
Pointer
A reference to the memory location of the next node.
Linked list advantage
Items can be added or removed easily without shifting data.
Traversing a linked list
Following pointers from the first node until the end of the list.
Stack
A data structure that uses Last In First Out (LIFO).
Push
Adding an item to the top of a stack.
Pop
Removing an item from the top of a stack.
Stack pointer
Points to the top of the stack.
Queue
A data structure that uses First In First Out (FIFO).
Enqueue
Adding an item to the back of a queue.
Dequeue
Removing an item from the front of a queue.
Head pointer
Points to the front of the queue.
Tail pointer
Points to the end of the queue.
Queue overflow
Attempting to add an item to a full queue.
Linear queue
A queue implemented using an array that does not reuse freed space.
Circular queue
A queue where the array wraps around to reuse space.
Tree
A non-linear data structure made up of nodes and edges.
Root node
The top node of a tree.
Leaf node
A node with no children.
Binary tree
A tree where each node has at most two children.
Binary search tree (BST)
A tree where left child values are smaller and right child values are larger.
Tree traversal
The process of visiting all nodes in a tree.
Post-order traversal
Left subtree right subtree then root.
Adding to a BST
Smaller values go left and larger values go right.
Removing a leaf node
The node is simply deleted.
Removing a node with one child
The node is replaced by its child.
Removing a node with two children
The node is replaced with the smallest value in the right subtree or largest in the left subtree.
Hash table
A data structure that stores key-value pairs using a hash function.
Hash function
Maps a key to an index in a hash table.
Collision
When two keys generate the same hash value.
Collision resolution (OCR)
The data is placed in the next available space.
Good hash function
Produces few collisions and distributes data evenly.