Uploaded by spicewolf10

Class notes 8-24

advertisement
CS 1337 (C++)
08/24/2022
-Pointers are where the memory address is stored
-A program is a series of steps to complete a well-defined task. A program could be a recipe, agenda, etc.
-What is a computer programming language ? Syntax(rules), punctuation symbols, and variables.
-Data Types-
-Primitive data types: int(4 bytes), double(8 bytes), float(4 bytes), bool(4 bytes), void(varies), -Derived data types: arrays, functions, pointers, reference (these are derived from the primitive types)
-Abstract or user-defined data type: Structures, unions, classes (only exist within the program and are created by the user)
-Constants-
-Named constants (they have the keyword "const" and MUST be initialized when declared)
-Symbolic constants (they have the keyword #define and they're a preprocessor directive)
-Algorithms-
-Similar to a program; well-defined steps to be performed to solve a task
-To represent an algorithm: FlowChart---> Diagram representing steps by boxes(shapes), connected by arrows
Terminal---> start/end, ellipse/circle
Process---> rectangle used to represent a specific operation or function
Decision---> Diamond/Romboid/Rhombus, usually associated with yes/no or true/false
Input/Output---> Parallelogram, represents sending or receiving information
-Pseudocode-
-Informal high level description of an algorithm
-In some cases, it includes reserved keywords, but itseld is not programming language-specific
-Algorithm ford-fulkerson is input: Graph G with flow capacity C,
source node s,
destination node t,
output: Flow f such that f is maximal from s to t;
for each edge (u,v) in G do
f(u,v) <- 0
f(v,u) <- 0
while there exist a path p from s to t in the residual network G,
do
{
}
--READ CHAPTER 2;
Download