Skip to content

AI and Programming Glossary

Last updated:

Original, plain-English definitions of the terms you'll run into when learning AI and writing code. Programming terms include the original worked examples and related practice already published in our content library.

AI terms

Agent Loop
The repeating cycle an agent runs on: decide the next step, take an action, observe the result, judge whether the goal is met, repeat. Feedback from real actions is what makes long tasks possible. It is also why errors compound, since a wrong observation becomes the premise for every step that follows.
Lesson: The agent loop →
Related:AI AgentTool UseContext Window
Agentic AI
An umbrella term for AI systems that take actions toward a goal rather than only producing text. The label describes the arrangement, not a new kind of model. It is used loosely in marketing, so it is worth asking which actions a particular product can actually take and what permissions it needs.
Topic hub: Agentic AI →
Related:AI AgentAgent LoopHuman-in-the-Loop
AI Agent
An AI system that can take multiple steps toward a goal on its own — deciding what to do next, using tools, and adjusting based on results — rather than just producing a single response to a single prompt.
Lesson: What an AI agent is →Article: What is agentic AI? →
Related:Large Language Model (LLM)Inference
AI Evaluation (Evals)
Testing a model or application against explicit success criteria on representative examples. Useful evaluations include failure cases, missing evidence and tool actions, and are repeated after a model or prompt changes.
Build a small AI evaluation →
Related:BenchmarkHallucinationGuardrails
API (Application Programming Interface)
A way for software to talk to other software. In AI, companies expose their models through APIs so developers can build apps that send a prompt and get a response back — without running the model themselves. When an app has AI built in, it is usually calling an API behind the scenes.
Related:Large Language Model (LLM)Inference
Artificial General Intelligence (AGI)
A proposed form of broadly capable artificial intelligence across many intellectual tasks. Definitions and measurements differ; a model's success on a selected benchmark does not by itself demonstrate AGI.
AI, AGI and ASI lesson →
Related:Artificial Intelligence (AI)Artificial Superintelligence (ASI / SI)Benchmark
Artificial Intelligence (AI)
Software designed to perform tasks that normally require human intelligence — understanding language, recognizing images, or making decisions. It's a broad goal, not one specific technique.
Lesson: What AI means today →
Related:Machine Learning (ML)Generative AI
Artificial Superintelligence (ASI / SI)
A proposed AI system exceeding human capability across a broad range of intellectual tasks. SI often means superintelligence in this context. It is a research concept, not a label established by a chatbot's confident response.
SI and ASI explained →
Related:Artificial General Intelligence (AGI)Artificial Intelligence (AI)
Benchmark
A standardized test used to compare AI models — a fixed set of questions or tasks scored the same way for every model. Benchmark scores are useful signals but imperfect: models can be tuned to score well on tests without being better at real-world work.
Related:Large Language Model (LLM)Training Data
Chain-of-Thought Reasoning
A technique where an AI model works through a problem step by step before giving its final answer, instead of jumping straight to a conclusion. Asking a model to think step by step often improves accuracy on math and logic problems, and many newer models do this automatically.
Related:Prompt EngineeringLarge Language Model (LLM)
Computer Vision
The field of AI focused on understanding images and video — recognizing objects, reading text in photos, detecting faces, or describing a scene. It's the technology behind photo search, medical image analysis, and self-driving car perception.
Related:Machine Learning (ML)Multimodal AI
Context Window
The maximum number of tokens a model can consider at once, including your input, any provided files, and its own reply. Content beyond this limit gets dropped or summarized.
Lesson: Tokens and context windows →
Related:TokenLarge Language Model (LLM)
Deep Learning
A type of machine learning that uses layered mathematical structures called neural networks, loosely inspired by how neurons connect in the brain. It's the technique behind most modern language and image models.
Article: What is a neural network? →
Related:Machine Learning (ML)Large Language Model (LLM)
Deepfake
AI-generated audio, images, or video that convincingly imitates a real person — their face, voice, or both. Some uses are legitimate (film dubbing, accessibility), but deepfakes made to deceive — fake statements, scams, non-consensual imagery — are harmful and increasingly regulated.
Related:Generative AIComputer Vision
Embeddings
A way of representing the meaning of text (or images) as a list of numbers, positioned so that similar meanings end up close together. This lets computers measure how related two pieces of content are.
Lesson: Embeddings and meaning →
Related:Retrieval-Augmented Generation (RAG)
Few-Shot Learning
Giving a model a small number of examples directly in your prompt before asking it to do the task, so it can pick up the pattern you want (format, tone, style) without any retraining.
Related:Zero-Shot LearningPrompt Engineering
Fine-Tuning
Further training an already-trained model on a smaller, specific dataset so it performs better on a narrower task or adopts a particular style, without starting from scratch.
Article: What is fine-tuning? →
Related:InferenceMachine Learning (ML)
Function Calling
The mechanism behind tool use: the model outputs structured text naming an action and its inputs, and the surrounding program executes it and feeds the result back. Because the model picks tools by matching their written descriptions, vague descriptions reliably produce wrong tool choices.
Lesson: Tools and function calling →
Related:Tool UseAI AgentAPI (Application Programming Interface)
Generative AI
AI systems built to produce new content — text, images, audio, or code — rather than just classify or predict a number. Chatbots and image generators are both generative AI.
Article: How does AI actually work? →
Related:Large Language Model (LLM)Artificial Intelligence (AI)
GPU (Graphics Processing Unit)
The computer chip that does most AI work. Originally built to render video game graphics, GPUs are good at doing many small calculations at once — exactly what training and running neural networks requires. AI demand is why these chips are now so valuable.
Related:Neural NetworkInferenceTraining Data
Grounding
Connecting an AI response to supplied or retrieved evidence. A grounded workflow should let a reader inspect the supporting material; the presence of a citation alone does not prove that the claim is supported.
RAG and grounding lesson →
Related:Retrieval-Augmented Generation (RAG)HallucinationEmbeddings
Guardrails
The safety measures built around an AI system — rules about what it will refuse, filters on inputs and outputs, and limits on what actions it can take. Guardrails are why a chatbot declines certain requests even though the underlying model could technically respond.
Lesson: Guardrails and human-in-the-loop →
Related:JailbreakSystem Prompt
Hallucination
When an AI model states something false, invented, or unsupported with the same fluent confidence as a correct answer. It happens because models generate statistically plausible text, not verified facts — always worth double-checking anything factual and important.
Article: AI hallucinations explained →Article: How to fact-check AI output →
Related:Large Language Model (LLM)Inference
Human-in-the-Loop
A design where a person reviews or approves certain steps rather than letting the system run unsupervised. For agents this usually means approval before actions that cannot be undone. It is a deliberate control choice, not a sign of immature technology, and it is most valuable at irreversible steps.
Lesson: Guardrails and human-in-the-loop →
Related:AI AgentGuardrailsAgentic AI
Inference
The process of a trained AI model actually producing an output for a given input — as opposed to "training," which is when the model is first built from data. Every time you send a prompt and get a reply, that's inference.
Related:Fine-TuningLarge Language Model (LLM)
Jailbreak
A prompt crafted to trick an AI model into ignoring its safety rules — for example, role-playing scenarios designed to get the model to produce content it would normally refuse. AI companies continuously patch against jailbreaks; attempting them typically violates a service's terms of use.
Lesson: Where agents fail →
Related:GuardrailsSystem Prompt
Large Language Model (LLM)
A deep learning model trained on huge amounts of text to predict what text should come next. This simple ability, at large scale, lets it answer questions, write, summarize, and hold conversations.
Article: LLM vs AI vs machine learning →Course: AI Fundamentals →
Related:Deep LearningGenerative AIToken
Machine Learning (ML)
A way of building AI systems by showing them many examples and letting them find statistical patterns, rather than hand-coding every rule. Most modern AI is built this way.
Lesson: How machines actually learn →Article: LLM vs AI vs machine learning →
Related:Artificial Intelligence (AI)Deep Learning
Model Context Protocol (MCP)
An open standard for connecting AI applications to external tools and data sources through a common interface, so a tool built once can be offered to different AI clients. It standardizes the plumbing of tool use; it does not by itself decide what an agent is permitted to do, which remains a matter of configuration.
Lesson: Tools and function calling →
Related:Tool UseFunction CallingAPI (Application Programming Interface)
Multi-Agent System
A setup where several agents with different roles work on parts of a task and pass results between them, such as one gathering information and another writing from it. Splitting roles can improve focus, but it also multiplies the number of places a misunderstanding can enter and makes runs harder to follow.
Course: Agentic AI →
Related:AI AgentAgent LoopHuman-in-the-Loop
Multimodal AI
An AI model that can understand or generate more than one type of content — for example, reading both text and images in the same conversation, rather than being limited to text alone.
Article: 8 AI tools worth knowing →
Related:Generative AILarge Language Model (LLM)
Natural Language Processing (NLP)
The field of AI focused on understanding and producing human language — translation, summarization, question answering, sentiment analysis. Large language models are the current state of the art in NLP.
Related:Large Language Model (LLM)Machine Learning (ML)
Neural Network
A mathematical structure made of layered, connected nodes that loosely mimics how neurons connect in a brain. Data passes through the layers, and each connection's strength is adjusted during training until the network produces useful output.
Article: What is a neural network? →Lesson: How machines actually learn →
Related:Deep LearningParameter
Open-Weight Model
A model with downloadable trained parameters, or weights. Open weights do not automatically mean open source or unrestricted reuse: permissions for running, modifying, commercial use and redistribution depend on the specific license and terms.
Open weights and licensing lesson →Article: ChatGPT vs Claude vs Gemini →
Related:Large Language Model (LLM)Parameter
Parameter
One of the internal numbers a model adjusts during training to get better at its task. Modern LLMs have billions of parameters — when you see a model described as "70 billion parameters," that's the count of these adjustable numbers, roughly indicating its scale.
Related:Neural NetworkMachine Learning (ML)
Prompt Engineering
The practice of deliberately structuring the instructions you give an AI model — including role, task, context, and format — to reliably get higher-quality, more predictable output.
Course: Prompt Engineering for Real Work →Article: What is prompt engineering? →
Related:Large Language Model (LLM)Context Window
Prompt Injection
An attempt to redirect an AI application's behavior through instructions embedded in content it reads, such as a document or tool result. Treat that content as data, restrict permissions and validate actions outside the model.
MCP and permissions lesson →
Related:JailbreakTool UseGuardrails
Reasoning Model
A model designed to use additional computation while solving a task. More reasoning effort can help on difficult problems, but does not guarantee a correct result and can increase time or cost.
Reasoning and multimodal AI lesson →
Related:Large Language Model (LLM)InferenceBenchmark
Retrieval-Augmented Generation (RAG)
A technique where a system first searches a set of documents for relevant information, then hands that information to a language model as extra context before it answers — improving accuracy on specific or private information.
Article: What is RAG? →
Related:EmbeddingsLarge Language Model (LLM)
Speech-to-Text (Speech Recognition)
AI that converts spoken audio into written text. It powers voice typing, meeting transcription, video captions, and voice assistants. Modern systems handle accents and background noise far better than the voice tech of a decade ago.
Related:Text-to-Speech (TTS)Machine Learning (ML)
System Prompt
Background instructions given to an AI model before your conversation starts, usually set by the application rather than you — defining its role, tone, or rules (e.g., "you are a helpful customer support agent"). You don't see it, but it shapes every reply.
Lesson: The four-part prompt →
Related:Prompt EngineeringLarge Language Model (LLM)
Temperature
A setting that controls how predictable or varied a model's output is. Low temperature makes it favor the single most likely next word every time (more focused, repeatable); high temperature lets it pick less-likely words more often (more varied, sometimes less coherent).
Related:InferenceLarge Language Model (LLM)
Text-to-Speech (TTS)
AI that converts written text into spoken audio. Modern TTS produces voices natural enough for audiobooks, video narration, and accessibility tools — a large jump from the robotic voices of earlier systems.
Related:Speech-to-Text (Speech Recognition)Generative AI
Token
The small chunk of text — a word, part of a word, or punctuation mark — that a language model reads and generates one unit at a time. In English, one token is roughly three-quarters of a word.
Lesson: Tokens and context windows →
Related:Context WindowLarge Language Model (LLM)
Tool Use
The ability of a model to request actions from software around it, such as searching the web, reading a file, or querying a database. The model never performs the action itself; it asks, and a program decides whether to comply. Anything outside its list of available tools is impossible for it, however it is prompted.
Lesson: Tools and function calling →
Related:Function CallingAI AgentAPI (Application Programming Interface)
Training Data
The large collection of examples — text, images, or other content — a model learns patterns from during training. A model's abilities and blind spots both trace back to what was and wasn't in its training data.
Lesson: How machines actually learn →
Related:Machine Learning (ML)Fine-Tuning
Transformer
The neural network design introduced in 2017 that made modern LLMs possible. Its key trick — called "attention" — lets the model weigh how relevant every other word in the input is to each word it's processing, which handles long-range context far better than earlier designs.
Related:Large Language Model (LLM)Neural Network
Zero-Shot Learning
Asking a model to perform a task it was never specifically shown examples of during training or in your prompt — relying entirely on what it learned generally. Most everyday chatbot use is zero-shot.
Related:Few-Shot LearningLarge Language Model (LLM)

New to these terms? Start with the AI Fundamentals course →

Programming terms

Jump to a definition, expand its code example, then use a related lesson or problem to practise the idea.

Algorithm
A step-by-step sequence of instructions that takes an input and produces a specific output in a finite number of steps.
Explanation

An algorithm is a precise, unambiguous set of steps for solving a problem — not just a loose description of an approach, but one specific enough that a computer (or a person following it exactly) could carry it out without guessing what to do next. A recipe for baking bread is a loose, everyday example: it lists ingredients (the input), a sequence of actions, and a finished loaf (the output). In programming, an algorithm is the plan your code follows, separate from the actual code that implements it — the same algorithm for sorting a list of numbers could be written in Python, JavaScript, or any other language and would still be "the same algorithm" underneath.

Example. Consider the goal "find the largest number in a list of five numbers." One algorithm: start by assuming the first number is the largest so far; then look at each remaining number one at a time, and whenever you find one bigger than your current "largest so far," update it; after checking every number, whatever you're holding is the answer. That sequence of steps — with no ambiguity about what to do at each stage — is an algorithm, regardless of which programming language eventually implements it.

Big O NotationTime ComplexitySortingSearchingRecursion
Array
A collection of elements stored in ordered, indexed positions, so any element can be accessed directly using its numeric position.
Explanation and code example

An array stores a sequence of values side by side, each one labeled by a numeric index that usually starts at 0 for the first element. Because every element's position is known, you can jump straight to any element — read it or change it — without stepping through the ones before it, which is what makes arrays fast for lookup by position. Python doesn't have a built-in type literally called "array" for everyday use; its list type fills that role and behaves like a resizable array, growing or shrinking as you add or remove elements.

Python
temperatures = [68, 72, 75, 71]
print(temperatures[2])      # 75 — the element at index 2 (the third value)
temperatures.append(69)
print(temperatures)          # [68, 72, 75, 71, 69]
Read the related lesson →Try a practice problem →Data StructureTwo PointersBinary SearchSorting
Big O Notation
A mathematical notation that describes how an algorithm's running time or memory use grows as its input size grows, ignoring constant factors.
Explanation

Big O notation describes how an algorithm's resource use — usually time, sometimes memory — scales as the input gets larger, without getting bogged down in exact numbers like "this took 3 milliseconds." It focuses on the growth trend for large inputs and drops constant factors and smaller terms, so an algorithm that does "2n + 5" operations is still described as O(n), because doubling the input still roughly doubles the work, and that linear relationship is what matters. Common categories, ordered from slowest-growing to fastest-growing work, include O(1) (constant, unaffected by input size), O(log n) (logarithmic), O(n) (linear), and O(n²) (quadratic).

Example. Searching a phone book of n entries by checking every entry one at a time takes an amount of work that grows in direct proportion to n — that's O(n). Searching the same phone book by repeatedly jumping to the middle of the remaining range and eliminating half of it (as binary search does) takes an amount of work that grows only in proportion to how many times n can be cut in half — that's O(log n), which grows far more slowly as n gets large.

Time ComplexitySpace ComplexityAlgorithm
Data Structure
A specific way of organizing and storing data in memory so it can be accessed and modified efficiently for a given task.
Explanation

A data structure is a container with rules: it decides how values are arranged, which operations are allowed — adding, removing, looking something up — and how fast each of those operations is. Different data structures make different trade-offs, and no single one is best for every job: an array gives fast access by position but slow insertion in the middle, while a linked list gives fast insertion anywhere but slow access by position. Choosing the right data structure for a task is often the single biggest factor in how efficient your program ends up being, well before you worry about fine-tuning the code itself.

Example. If your program mainly needs to look values up by a name or ID rather than by position, a hash table will typically serve that need far faster than scanning through a plain list every time it needs an answer; if it mainly needs to add and remove items from one end in a strict order, a stack or a queue fits the job better than either one.

ArrayHash TableStackQueueLinked List
Dynamic Programming
A problem-solving technique that speeds up recursive algorithms by storing the results of subproblems so they're never recomputed.
Explanation and code example

Some recursive solutions end up solving the exact same subproblem many times over — for example, a naive recursive Fibonacci function recalculates fibonacci(2) dozens of times while computing fibonacci(10). Dynamic programming fixes this by saving each subproblem's result the first time it's computed, usually in a dictionary or list, and reusing that saved result instead of recalculating it — a technique called memoization. This trade of a little extra memory for a large reduction in repeated work can turn a recursive solution that takes exponential time into one that takes only linear time.

Python
def fibonacci(n, memo=None):
    if memo is None:
        memo = {}
    if n in memo:
        return memo[n]
    if n <= 1:
        return n
    memo[n] = fibonacci(n - 1, memo) + fibonacci(n - 2, memo)
    return memo[n]

print(fibonacci(10))   # 55
Try a practice problem →RecursionAlgorithmTime ComplexitySpace Complexity
Edge Case
An input or condition at the extreme boundaries of what a program must handle — such as an empty input, a single element, or a maximum value — that's easy to overlook when writing code.
Explanation and code example

An edge case is an input that sits at the boundary of what your code was designed to handle, rather than a typical, "normal" input — an empty list, a single-character string, a negative number where you expected a positive one, or the very first or last element of a collection. Code that looks correct when you test it with ordinary inputs can still fail on these boundary inputs if you didn't specifically consider them while writing it, which is why deliberately testing edge cases is one of the most effective habits for catching bugs before they reach users. Common edge cases worth checking include an empty collection, a collection with exactly one element, duplicate values, and the largest or smallest values a program is expected to support.

Python
def average(numbers):
    return sum(numbers) / len(numbers)

print(average([2, 4, 6]))   # 4.0 — works fine for a typical list
print(average([]))           # ZeroDivisionError — the empty-list edge case was never handled
AlgorithmArrayString
Hash Table
A data structure that maps keys to values using a hash function, giving average-case constant-time lookup, insertion, and deletion.
Explanation and code example

A hash table stores data as key-value pairs and uses a hash function — a calculation that turns a key into a number — to decide exactly where that pair should be stored. That's what makes lookups so fast: instead of scanning through every stored item to find a match, the hash table recalculates the hash of the key you're searching for and jumps almost directly to where it should be. Python's built-in dict type is a hash table: keys can be strings, numbers, or other immutable values, and looking up a value by its key takes roughly the same amount of time whether the dictionary holds ten entries or ten million.

Python
inventory = {"apples": 40, "bananas": 25}
inventory["cherries"] = 60      # insert a new key-value pair
print(inventory["bananas"])      # 25 — found directly by key, no scanning required
print("grapes" in inventory)      # False
Try a practice problem →Data StructureArrayTime Complexity
Linked List
A data structure made of nodes, where each node holds a value and a reference to the next node, forming a chain instead of contiguous memory.
Explanation and code example

Unlike an array, whose elements sit next to each other in memory at fixed positions, a linked list is built from separate nodes scattered wherever memory happens to be free, each one holding a value plus a pointer (a reference) to the next node in the chain. To reach the fifth node, you have to walk the chain from the first node through the fourth, since there's no way to jump directly to a position the way you can with an array index. That trade-off — slower access by position, but the ability to insert or remove a node anywhere without shifting every other element — is what makes linked lists useful in situations where an array's contiguous layout would be inconvenient.

Python
class Node:
    def __init__(self, value, next=None):
        self.value = value
        self.next = next

head = Node("a", Node("b", Node("c")))
current = head
while current:
    print(current.value)     # prints "a", then "b", then "c"
    current = current.next
Data StructureArrayQueue
Palindrome
A sequence — such as a word, phrase, or number — that reads the same forwards and backwards.
Explanation and code example

A palindrome is any sequence that's identical whether you read it from the front or from the back — "racecar" and "level" are palindromes, while "python" is not, since reversing it gives a different sequence. Checking whether something is a palindrome is a common exercise for practicing string manipulation and the two-pointers technique, since you can compare characters from both ends moving inward instead of building and comparing a fully reversed copy. Palindrome checks sometimes need to decide how to treat spaces, punctuation, and letter case — "A man, a plan, a canal: Panama" only reads as a palindrome once those are stripped out and the letters are lowercased.

Python
def is_palindrome(word):
    return word == word[::-1]     # word[::-1] reverses the string

print(is_palindrome("racecar"))  # True
print(is_palindrome("python"))    # False
Try a practice problem →StringTwo Pointers
Queue
A first-in, first-out (FIFO) data structure where elements are added at the back and removed from the front.
Explanation and code example

A queue models a waiting line: new elements join at the back, and the only element you can remove is the one at the front, which is whichever element has been waiting longest. This "first in, first out" order is the opposite of a stack's last-in-first-out order, even though both structures restrict you to adding and removing at specific ends. Queues show up naturally whenever things need to be processed in the order they arrived, such as tasks waiting to be handled or messages waiting to be delivered.

Python
from collections import deque

line = deque()
line.append("Alex")
line.append("Bo")
line.append("Cam")
print(line.popleft())  # "Alex" — the first person to join is the first to leave
print(line)              # deque(['Bo', 'Cam'])
Data StructureStackLinked List
Recursion
A technique where a function solves a problem by calling itself on smaller versions of the same problem until it reaches a base case.
Explanation and code example

A recursive function is one that calls itself, but with a smaller or simpler input each time, gradually working its way down toward a base case — a version of the problem simple enough to answer directly, without any further self-calls. Every recursive function needs that base case, or it will keep calling itself forever (in practice, Python will eventually raise a RecursionError once it runs out of call-stack space). Recursion suits problems that are naturally defined in terms of smaller versions of themselves, such as computing a factorial or walking through a nested structure like a linked list.

Python
def factorial(n):
    if n == 0:                     # base case: stop recursing
        return 1
    return n * factorial(n - 1)     # recursive case: solve a smaller subproblem

print(factorial(4))   # 24  (4 * 3 * 2 * 1 * 1)
Try a practice problem →AlgorithmDynamic ProgrammingStackSpace Complexity
Searching
The process of locating a specific value or item within a collection of data.
Explanation and code example

Searching means checking a collection to find out whether a particular value is present, and if so, where. The simplest approach, linear search, checks each element one at a time from the start until it finds a match or runs out of elements — it works on any collection, sorted or not, but in the worst case has to examine every element. When the data is already sorted, a smarter approach like binary search can find a match while examining far fewer elements, which is why the structure of your data often determines which search strategy makes sense.

Python
def linear_search(items, target):
    for index, value in enumerate(items):
        if value == target:
            return index      # found it — return its position
    return -1                  # target not found anywhere in items

print(linear_search([4, 8, 15, 16, 23], 15))  # 2
Try a practice problem →AlgorithmBinary SearchArrayTime Complexity
Sorting
The process of arranging the elements of a collection into a specific order, typically ascending or descending.
Explanation and code example

Sorting rearranges a collection's elements — numbers, strings, or any comparable values — into a defined order, most often smallest-to-largest or largest-to-smallest. Many different sorting algorithms exist, and they differ mainly in how much time and extra memory they need as the list grows: some, like bubble sort, are simple to understand but slow on large lists, while others, like the algorithm behind Python's built-in sort, are more complex but scale well. Sorting is also a common first step before other operations, since some techniques — including binary search — only work correctly on data that's already sorted.

Python
scores = [42, 17, 89, 3, 56]
print(sorted(scores))                 # [3, 17, 42, 56, 89] — ascending order
print(sorted(scores, reverse=True))    # [89, 56, 42, 17, 3] — descending order
AlgorithmArrayTime ComplexitySearching
Space Complexity
A measure of how much extra memory an algorithm needs as its input size grows, usually expressed using Big O notation.
Explanation and code example

Space complexity measures how much additional memory an algorithm needs beyond the input it was given, and how that extra memory usage grows as the input grows. A function that builds a brand-new list the same size as its input needs O(n) extra space, while a function that only uses a few fixed variables — no matter how large the input is — needs O(1) extra space, also called constant space. Recursive functions have a space cost that's easy to overlook: each call waits on the call stack until its recursive call returns, so a recursive function with n nested calls uses O(n) space for the call stack alone, even if it never creates a single new list.

Python
def double_values(numbers):           # O(n) space — builds a brand-new list of the same size
    return [n * 2 for n in numbers]

def double_values_in_place(numbers):  # O(1) extra space — modifies the existing list directly
    for i in range(len(numbers)):
        numbers[i] *= 2
    return numbers
Big O NotationTime ComplexityRecursion
Stack
A last-in, first-out (LIFO) data structure where elements are added and removed only from the same end, called the top.
Explanation and code example

A stack only lets you interact with one end of its collection, called the top: you can push a new element onto the top, or pop the top element off, but you can't reach into the middle. This "last in, first out" behavior means the most recently added item is always the first one to come back out — like a stack of plates, where you add and remove plates from the top, not the bottom. Stacks are a natural fit for problems involving nested or reversible structure, such as checking whether every opening bracket in an expression has a matching closing bracket.

Python
stack = []
stack.append("a")
stack.append("b")
stack.append("c")
print(stack.pop())   # "c" — the most recently added item comes off first
print(stack)           # ["a", "b"]
Try a practice problem →Data StructureQueueRecursion
String
A sequence of characters used to represent text, treated in Python as an ordered, immutable collection you can index and slice.
Explanation and code example

A string is a piece of text — a sequence of individual characters stored in order, written between quotes in Python source code. Like an array, each character in a string sits at a numeric index, so you can read a single character or a range of characters by position. Unlike a Python list, however, a string is immutable: once created, you can't change one of its characters in place, so any "modification" — like uppercasing it or replacing a letter — actually produces a brand-new string rather than editing the original.

Python
greeting = "hello"
print(greeting[1])        # "e" — the character at index 1
print(greeting.upper())    # "HELLO" — a new string; greeting itself is unchanged
print(greeting)             # "hello"
Try a practice problem →ArrayPalindromeTwo Pointers
Time Complexity
A measure of how the number of operations an algorithm performs grows as its input size grows, usually expressed using Big O notation.
Explanation and code example

Time complexity answers the question "as the input gets bigger, how much more work does this algorithm have to do?" — not measured in actual seconds, which depends on the computer running it, but in how the number of basic operations scales with input size. A function that loops once over every element of a list of size n does roughly n units of work, so its time complexity is O(n); a function that only ever looks at one fixed element, regardless of how big the list is, does a constant amount of work, so its time complexity is O(1). Comparing time complexities lets you predict which of two approaches will hold up better as the input grows, even before you've measured either one running.

Python
def print_all(items):        # O(n) — one loop through every item, work grows with input size
    for item in items:
        print(item)

def print_first(items):      # O(1) — constant time, regardless of how long items is
    print(items[0])
Big O NotationSpace ComplexityAlgorithm
Two Pointers
A technique that uses two index variables moving through a sequence — often from opposite ends or at different speeds — to solve problems in a single pass.
Explanation and code example

The two-pointers technique tracks two positions in a list or string at the same time, instead of just one, and moves them according to rules that depend on the problem. A common pattern is to start one pointer at the beginning and one at the end, then move them toward each other, comparing the elements they point to as they go — useful for checking whether a sequence reads the same forwards and backwards. Because both pointers move through the sequence only once between them, this technique often turns a solution that would otherwise need nested loops into one that runs in a single linear pass.

Python
def is_palindrome(text):
    left, right = 0, len(text) - 1
    while left < right:
        if text[left] != text[right]:
            return False
        left += 1
        right -= 1
    return True

print(is_palindrome("level"))  # True
Try a practice problem →ArrayStringPalindrome

Questions about this glossary

How to use these definitions, and what they deliberately leave out.

Why are the definitions here so short?
Because a definition you can hold in your head is more useful than a complete one you skim. Each entry aims for the amount you need to follow an article or a conversation without stopping. The tradeoff is that nuance gets left out, so where a term carries real disagreement or detail, the linked courses and articles go further than the entry does.
Do I need to memorize all of these AI terms?
No, and trying to is a poor use of your time. Vocabulary sticks when you meet it inside something you are actually reading, not when you drill it in isolation. A better habit is keeping this page open while you work through a course or an article and looking terms up as they appear. A handful come up often enough to learn by accident.
Are these the official definitions of these terms?
There is no official body that defines AI vocabulary, so no. Companies use the same words in slightly different ways, and marketing stretches some terms well past their original meaning. These entries describe how a word is most commonly used in practice. When a company uses a term differently, its own documentation governs its product, not this page.
What is the difference between AI, machine learning, and generative AI?
They sit inside one another. Artificial intelligence is the broad aim of software doing things that normally need human intelligence. Machine learning is the main method used to get there, finding patterns in examples instead of following hand-written rules. Generative AI is a subset of that: systems producing new text, images, audio, or video rather than only sorting or predicting.
A term I came across is not in this glossary. What should I do?
Suggest it through the contact page — missing terms are among the easiest requests to act on, and the list grows that way. In the meantime, the quickest route is usually the documentation of whichever product used the word, since new terms often begin as one company's branding before spreading into general use.