The C++Course provides a general introduction to programming in C++. It is based on A.B. Downey's book, How to Think Like a Computer Scientist. Click here for details.

Glossary K...P

keyAn index, of any type, used to look up values in a table.
keywordA reserved word that is used by the compiler to parse programs. Examples we have seen include int, void and endl.
leafA bottom-most node in a tree, which refers to no other nodes.
levelThe set of nodes equidistant from the root.
linear timeAn operation whose run time is a linear function of the size of the data structure.
linkAn object reference embedded in an object.
linked queueAn implementation of a queue using a linked list and references to the first and last nodes.
listA data structure that implements a collection using a sequence of linked nodes.
load factorThe number of entries in a hashtable divided by the number of lists in the hashtable; i.e. the average number of entries per list.
local variableA variable that is declared inside a function and that exists only within that function. Local variables cannot be accessed from outside their home function, and do not interfere with any other functions.
logical errorAn error in a program that makes it do something other than what the programmer intended.
logical operatorAn operator that combines boolean values in order to test compound conditions.
loopA statement that executes repeatedly while a condition is true or until some condition is satisfied.
low-level languageA programming language that is designed to be easy for a computer to execute. Also called "machine language" or "assembly language."
member functionA function that is declared within the class defintion of an object. It is invoked directly on an object using dot notation.
mergesortAn algorithm for sorting a collection of values. Mergesort is faster than the simple algorithm in the previous chapter, especially for large collections.
method encapsulationThe design goal of keeping the interface of a method separate from the details of its implementation.
methodA named sequence of statements that performs some useful function. Methods may or may not take parameters, and may or may not produce a result.
modifierA function that changes one or more of the objects it receives as parameters, and usually returns void.
modulusAn operator that works on integers and yields the remainder when one number is divided by another. In C++ it is denoted with a percent sign (%).
natural languageAny of the languages people speak that have evolved naturally.
nestingPutting a conditional statement inside one or both branches of another conditional statement.
newan operator that returns a pointer of the appropriate data type, which points to the reserved place.
nodeAn element of a list, usually implemented as an object that contains a reference to another object of the same type.
nonmember functionA function defined outside any class or structure defintion. Nonmember functions are not invoked on objects and they do not have a current object. Also called a "free-standing" function.
objectA collection of related data that comes with a set of functions that operate on it. The objects we have used so far are the cout object provided by the system, and pstrings.
object codeThe output of the compiler, after translating the program.
object encapsulationThe design goal of keeping the implementations of two objects as separate as possible. Neither class should have to know the details of the implementation of the other.
object methodA method that is invoked on an object, and that operates on that object, which is referred to by the keyword this in Java or "the current object" in English. Object methods do not have the keyword static.
operandOne of the values on which an operator operates.
operatorA special symbol that represents a simple computation like addition or multiplication.
order of growthA set of functions with the same leading-order term, and therefore the same qualitative behavior for large values of n.
ordered setA data structure in which every element appears only once and every element has an index that identifies it.
overheadAdditional time or resources consumed by a programming performing operations other than the abstract operations considered in performance analysis.
overloadingHaving more than one function with the same name but different parameters. When you call an overloaded function, C++ knows which version to use by looking at the arguments you provide.
packageA collection of classes. The built-in Java classes are organized in packages.
parameterA piece of information you provide in order to call a function. Parameters are like variables in the sense that they contain values and have types.
parentThe node that refers to a given node.
parseTo examine a program and analyze the syntactic structure.
pass by referenceA method of parameter-passing in which the parameter is a reference to the argument variable. Changes to the parameter also affect the argument variable.
pass by valueA method of parameter-passing in which the value provided as an argument is copied into the corresponding parameter, but the parameter and the argument occupy distinct locations.
performance hazardA danger associated with a veneer that some of the methods might be implemented inefficiently in a way that is not apparent to the client.
pixelThe unit in which coordinates are measured.
pointera variable that holds an address in memory. Similar to a reference, however, pointers have different syntax and traditional uses from references.
portabilityA property of a program that can run on more than one kind of computer.
postconditionA predicate that must be true at the end of a method or function (provided that the preconditions were true at the beginning).
postfixA way of writing mathematical expressions with the operators after the operands.
postorderA way to traverse a tree, visiting the children of each node before the node itself.
precedenceThe order in which operations are evaluated.
preconditionA condition that is assumed to be true at the beginning of a function. If the precondition is not true, the function may not work. It is often a good idea for functions to check their preconditions, if possible.
predicateA mathematical statement that is either true or false.
prefix notationA way of writing a mathematical expression with each operator appearing before its operands.
preorderA way to traverse a tree, visiting each node before its children.
priority queueA queueing discipline in which each member has a priority determined by external factors. The member with the highest priority is the first to be removed.
privateA keyword that indicates that a method or instance variable cannot be accessed from outside the current class definition.
problem-solvingThe process of formulating a problem, finding a solution, and expressing the solution.
projectA collection of one or more class definitions (one per file) that make up a program.
prototypeA way of describing the interface to a method using Java-like syntax.
providerThe code that implements an ADT (or the person who wrote it).
pseudocodeA way of designing programs by writing rough drafts in a combination of English and C++.
pseudorandomA sequence of numbers that appear to be random, but which are actually the product of a deterministic computation.
pure functionA function whose result depends only on its parameters, and that has so effects other than returning a value.

Last Update: 2005-11-22