1/35
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Data Structure
A systematic way of organizing and accessing data.
Algorithm
A generic step-by-step set of instructions for solving a problem.
Program
An implementation of an algorithm in code.
Abstract Data Type (ADT)
A theoretical model of a data structure that specifies what operations are allowed but not how they are implemented.
Big O Notation
Describes the worst-case complexity of an algorithm.
O(1)
Constant time – operations take the same time regardless of input size.
O(n)
Linear time – performance scales directly with input size.
O(n²)
Quadratic time – performance scales with the square of input size.
O(log n)
Logarithmic time – performance scales logarithmically with input size.
O(bⁿ)
Exponential time – performance doubles with each additional input.
O(n!)
Factorial time – performance grows extremely fast with input size.
Inheritance
A class can inherit attributes and methods from another class.
Constructor (init)
A special function that initializes an object.
Import
Brings in external modules to use functions or classes.
Functions
Blocks of reusable code that perform a task.
Public attributes
Attributes that are accessible from anywhere.
Protected attributes
Conventionally private attributes that are still accessible.
Private attributes
Name-mangled attributes to prevent direct access.
str Method
Defines how an object is represented as a string.
Naming Conventions
Use snake_case for variables/functions and PascalCase for class names.
self Keyword
Refers to the instance of the class.
Stack (LIFO)
A data structure where the last item added is the first to be removed.
push(item)
Adds an item to the top of the stack.
pop()
Removes and returns the top item from the stack.
peek()
Returns the top item of the stack without removing it.
size()
Returns the number of elements in the stack.
is_empty()
Returns True if the stack is empty.
Queue (FIFO)
A data structure where the first item added is the first to be removed.
enqueue(item)
Adds an item to the back of the queue.
dequeue()
Removes and returns the front item from the queue.
Deque (Double-Ended Queue)
A data structure that allows insertion and removal from both ends.
add_front(item)
Adds an item to the front of the deque.
remove_front()
Removes and returns the front item from the deque.
Node
Basic building block for linked structures, stores data and points to the next node.
data
Stores the value of the node.
next
Points to the next node in a linked list.