Shared Flashcard Set

Details

Midterm 1 review
Na
21
Computer Science
Undergraduate 3
10/20/2010

Additional Computer Science Flashcards

 


 

Cards

Term
Procedural Programming
Definition
The focus of procedural programming is on developing subprograms to perform certain tasks (the verbs). In procedural programming, data items being processes are passed from one subprogram to another.
Term
Object-Oriented Programming
Definition
The focus of object-orientated programming is on identifying objects and how they should work together to solve a program (the nouns). In object-oriented programming, messages are sent to an object instructing it to operate itself in some way. Object-oriented programming applies the I-can-do-it-myself principle, were objects can carry their own operations around with them.
Term
List ADT
Definition
A finite sequence of homogeneous data items and the operations performed on them.
Term
Cons of Using Dynamic Arrays for Lists
Definition
1) Fixed Capacity
2) List class is bound to a particular type
Term
Cons of Linked Lists
Definition
1) No direct access to certain element
Term
Cons of Using Static Arrays
Definition
"One Size fits all". If the capacity is too large, memory is wasted and if it's too small, it limits the size of the list.
Term
Stack ADT
Definition
A finite sequence of data items that can only be accessed at one end, called the top of the stack (i.e. Last-in, First-out).
Term
String ADT
Definition
A finite sequence of characters drawn from some given character set.
Term
What's the difference between structs and classes?
Definition
Struct members are public by default while class members are private by default.
Term
Types of tests to ensure the software works properly
Definition
Unit tests = testing a subprogram or code segment individually.
Integration tests = check if the program units have been combined correctly.
System tests = check if the overall system of programs, subprograms, and libraries perform correctly.
Term
Waterfall Model
Definition
1) Identify system requirements
2) Design the system and software units
3) Code and test the units
4) Integrate the units and test the system
5) Deploy, operate, and maintain the system
Term
What's a Copy Constructor?
Definition
A copy constructor is called whenever a new variable is created from an object. C++ calls the copy constructor to make a copy of an object. If there's no copy constructor defined, C++ uses a default copy constructor.
Term
What is >>?
Definition
Extraction operator (i.e. input operator)
Term
What is <
Definition
Stream insertion operator (i.e. output operator)
Term
Why do we need to overload the assignment operator in Linked Lists?
Definition
If the assignment operator isn't overloaded, C++ will use the default assignment operator to make a shallow copy, which will create aliasing problems and memory leaks.
Term
Convert the postfix expression to infix:
ab-c-d*
Definition
(a - b - c) * d
Term
Convert the following to postfix notation(a - (b - c)) * d
Definition
abc - - d *
Term
Convert this expression to prefix:
a * (b + c) / d
Definition
/ * a + b c d
Term
Convert this postfix expression to prefix:
(A (B (C D /) +) *)
Definition
(* A (+ B (/ C D) ) )
Term
What are the data members of a Dynamic Stack class?
Definition
int myCapacity; // capacity of stack
int myTop; // top of stack
StackElement * myArray; //dynamic array to store
Term
What 3 things must the compiler do when it encounters a variable declaration?
Definition
1) Memory allocated for value of specific value
2) Variable name associated with that memory location
3) Memory initialized with values provided (if any)
Supporting users have an ad free experience!