A term or series of terms separated by operators that evaluate to a single value and that value has a type.
In a boolean expression if C can determine the value based on the first term, it will stop there. For example in an OR expression, it evaluates as true if the first term is true. In a AND it will evaluate the whole expression as false if the first term is false.
It evaluates before the function is executed x. The value of x is incremented.
It evaluates after the function is executed. A copy of the value of x is recorded before we change it and increment .
A variable that stores the memory address of another variable. Pointers are indicated by * (dereferecing operator)
Gives context so the program knows the type
Function that takes a pointer to the space in memory that has been allocated and it will deallocate memory.
Tells the compiler to interpret the memory with a different context.
A dynamic array. It has size, capacity and data( a data pointer to the array).
A constructor is a member function of a class that is called automatically when an object of the class is declared. A constructor must have the same name as the class of which it is a member.
A destructor is a special kind of member function for a class. A destructor is called automatically when an object of the class passes out of scope. The main reason for destructors is to return memory to the freestore manager so the memory can be reused.
A copy constructor is a constructor that has a single argument that is of the same type as the class. If you define a copy constructor, it will be called automatically whenever a function returns a value of the class type and whenever an argument is plugged in for a call-by-value parameter of the class type. Any class that uses pointers and the operator new should have a copy constructor.
An accessor function allows access to private data members in C++. It does not modify the data, it only accesses it.
Modifies a protected data member.
When a function has the same name, but different numbers or types of parameters(signature).
private : Hidden from the user. When the programmer labels data members "private," they cannot be accessed and manipulated by member functions of other classes. Accessors allow access to these private data members.
public : The user has access to it.
Member : The member functions have special access to the data of their object.
If you have an object that is dynamically allocated and you need to manage the data.
Starting at the beginning of a list, compare adjacent pair of elements if the pair is out of order swap them, do it n-1 times.
Sorts the list by repeatedly finding the smallest element from the list starting at i, sort into the i position, do this for all except for the last and putting at the beginning. Remember where the smallest is, then you swap it. Where I starts at 0.
Heapify the array, remove the max n-1 times. Heapify means call fix down at every node of the tree starting at the back of the array ignoring leaf nodes( Nodes that don’t have children).
Using index-1 of an unsorted list as a starting point, increment the starting point through the list insertion each element into its proper location relative to the numbers preceding the starting point.
Do insertion sort on the list, except comparing elements that are one away, compare elements that are h away.
Everything in the left subtree is smaller than everything in the right subtree.
A tree in which every node other than the leaves has two children.
The children has all the children that it can have.
Trees can be traversed in 3 different ways: