classes, stacks, searches, Flashcards
data encapsulation
a method of bundling data and the function that uses them
data abstraction
a mechanism of only exposing interfaces and hiding implimentation details from the user.
what is special about all functions declared after public:
ther are accessable by any part of the program
linear search
iterates from ones side to the other until the target is found
requires nothing of the user
binary search
goes to the middle index, determines which side the item is on, goes to the middle of that one, repeats.
requires the list to be sorted
time for binary and linear search
logarithamic and linear
ADT
Abstract Data type (ADT) is a type (or class) for objects whose behavior is defined by a set of value and a set of operations.
converting from an interger to its character code
character = value +’0’
converting from character value to interger
value = character - ‘0’
what must be added to each header in stack.cpp
stack::
how to compile with linked lists
clang++ -std= c++11
equivalent to headptr -> item = 2;
(*headptr).item = 2;
equivalent to (*headptr).item = 2;
headptr -> item = 2;