CS 235 Final
Which of the following is in correct descending precedence order? (a) (), ~, ==, || (b) [], <<, +, % (c) *(unary), *, &, + (d) &, &&, ^, |
(a) (), ~, ==, ||
Which of the following is an example of an 'is-a' relationship? (a) a jet plane is a plane (b) a plane is a jet plane (c) a train engine is a train (d) a train is a train engine
(a) A jet plane is a plane
What is true of C++ strings? (a) a C++ string is an alias for basic_string<char> (b) character arrays and strings are identical (c) memory for a C++ string must be pre-allocated (d) C++ strings lose type and dimension when passed to a function
(a) a C++ string is an alias for basic_string<char>
What is TRUE of friend functions? (a) a friend functions is a non-member function with access to the class private and protected members (b) friend functions in a class definition are member functions of the class (c) friendship is inherited (d) if A is friend of B, then B automatically becomes a friend of A
(a) a friend function is a non-member function with access to the class private and protected members
All of the following are true of Big-O analysis except what? (a) a simple way to determine the big-O of an algorithm or program is to look at the loops invariants (b) algorithms with exponential and factorial growth rates have an effective practical limit on the size of the problem they can be used to solve (c) in general, it is safe to ignore all constants and to drop the lower-order terms when determining the order of magnitude (d) the growth rate of f(n) will be determined by the fastest growing term, which is the one with the largest exponent
(a) a simple way to determine the big-O of an algorithm or program is to look at the loops invariants
Which of the following is NOT a disadvantage of a single-linked list compared to a double linked list? (a) Nodes in a single linked list contain more data that nodes in a double linked list (b) a single linked list can only insert a node after a node we have a pointer to (c) a single linked list can only be traversed in the forward direction (d) a single linked list can remove a node only if it was a previous node
(a) nodes in a single linked list contain more data that nodes in a double linked list
What is true of C++ streams? (a) the class istream defines the extraction operator(>>) for primitive data types (b) a stream is an entity where a program can only extract characters (c) the istream class stream inherits from the class ifstream (d) file streams associate streams with C++ data types
(a) the class istream defines the extraction operator(>>) for primitive data types
All of the following are true of iterators EXCEPT what? (a) the iterator end() function returns a pointer to the last element in the container (b) iterators allow you to traverse container members using pointer-lie semantics (c) iterators provide abstraction away form the "how" to traverse a container (d) iterators are in essence improved version of pointers from C (e) Iterators in STL allow algorithms to be written independent of the manner in which the data is stored
(a) the iterator end() function returns a pointer to the last element in the container
The default copy constructor may be used EXCEPT (a) when a deep copy is required (b) when an object is constructed based on another object of the same class (c) when an object of the class is passed (to a function) by value as an argument (d) when an object of the class is returned by value (e) when the compiler generates a temporary object
(a) when a deep copy is required
What is true of C++ pointer variables? (a) a pointer variable contains the variable value (b) array pointers enable us to conveniently process groups of data such as vectors, lists, and strings (c) pointers prevent functions from modifying the arguments passed by the caller function (d) the ampersand (&) indicates that the following identifier is a pointer variable
(b) array pointers enable us to conveniently process groups of data such as vectors, lists, and strings
A temple class typically... (a) accommodates a variety of containers that have the same set of core operations (b) facilitates the same set of operations on a variety of data types (c) is a class (such as vector) that has a data member of another class (such as array) (d) is an abstract class without a specific implementation
(b) facilitates the same set of operations on a variety of data types
Pick the best statement: (a) both preconditions and the postcondition must be met (b) if the preconditions are met, the postconditions must be achieved (c) if the preconditions are not met, the postconditions will not be achieved (d) the preconditions and postconditions are independent of each other
(b) if the preconditions are met, the postconditions must be achieved
Which of the following is true about multiple inheritance? (a) C++ does not support multiple inheritance (b) multiple inheritance can often be avoided by refactoring (c) the constructors of inherited classes are called in reverse order in which they are inherited (d) with multiple inheritance, all the variables of the base classes have different names
(b) multiple inheritance can often be avoided by refactoring
What is true of translation units? (a) all source files, together with their included header files, are called the translation units (b) translation units are compiled into object files that are joined together by the linker (c) static objects in a source file are accessible across translation units (d) a single translation unit can't be compiled into a library
(b) translation units are compiled into object files that are joined together by the linker
which of the following is NOT a reason to override a function? (a) you are writing a function to implement an ADT (b) you make a child class so you need to override every function (c) you want to change the functionality of a derived class (d) you want to add to the functionality of the base class
(b) you made a child class so you need to override every function
What is FALSE concerning pointers and references? (a) a pointer variable can be assigned a value at any time, while a reference variable cannot be reassigned (b) a pointer variable is a variable that holds a memory address (c) a reference variable has a different memory address than the item it references (d) a reference variable is an alias for an already existing variable
(c) a reference variable has a different memory address than the item is references
Which of the following is TRUE concerning abstract classes and concrete classes? (a) concrete classes can define variables, but abstract classes cannot (b) concrete classes can extend another class, but abstract classes cannot (c) abstract classes can declare abstract member functions, but concrete classes cannot (d) abstract classes can extend another class, but concrete classes cannot
(c) abstract classes can declare abstract member functions, but concrete classes cannot
Which of the following is NOT a reason to use a linked-list over a vector? (a) removal from a linked-list is more efficient (b) inserting at the beginning of a linked list is more efficient (c) accessing any given element in a linked list is more efficient (d) all of the above are reasons why the linked-list is superior
(c) accessing any given element in a linked-list is more efficient
Pick the best statement: (a) An ADT is represented by a .cpp file (b) an ADT is represented by a .h file (c) An ADT is represented by a class consisting of abstract functions (d) an ADT is represented by the combination of a .h file and an associated .cpp file
(c) an ADT is represented by a class consisting of abstract functions
The pre-processor conditional compilation directives (a) act the same as /*...*/ (b) are evaluated at run-time (c) are used to eliminate lines at compilation time (d) cannot be nested
(c) are used to eliminate lines at compilation time
What features are considered fundamental by the C++ standard to containers? (a) containers grow as needed (b) containers hold objects (c) both of the above (d) none of the above
(c) both of the above
inclusion of the keyword const in a function header does all of the following EXCEPT (a) alert the suer that the function will not change values (b) disallow changes in values (c) force the return type to be a constant (d) incorporate optimizations
(c) force the return type to be a constant
What is NOT true of an array? (a) an array name is the address of its first element (b) statically declared arrays are allocated memory at compile time (c) the C++ compiler is able to deduce an array size from the array pointer (d) you can use array notation (e.g. int[]) or pointer notation (e.g. int*) in a function declaration
(c) the C++ compiler is able to deduce an array size from the array pointer
Suppose we are trying to use multiple inheritance, but the compiler reports that there is an ambiguity about our variable named 'var'. What can we do to resolve this error? (a) refactor the parent classes by combining them (b) rename the variable of one of the parent classes (c) specify which parent you are talking the variable from with 'Parent1::var' (d) All of the above
(d) All of the above
Which of the following is TRUE of UML diagrams? (a) a UML "has-a" relationship is indicated with a white triangle arrowhead facing the parent class (b) a UML "is-a" relationship is indicated with a filled diamond arrow (c) the circle with a cross through it indicates an inheritance relationship (d) UML virtual functions are italicized
(d) UML virtual functions are italicized
Which of the following is an example of an 'has-a' relationship? (a) a jet plane has a plane (b) a plane has a jet plane (c) a train engine has a train (d) a train has a train engine
(d) a train has a train engine
What is the advantage of placing the word const in the function declaration and in the function definition? (a) any operation that could modify the object is flagged (b) it facilitates optimizations in the machine code (c) this tells the user that the function will not modify the associated object (d) all of the above are true
(d) all of the above are true
Which of the following is a FALSE statement? (a) an abstract class can extend another abstract class (b) an abstract class can not be instantiated (c) pointers to an abstract class may be declared (d) an abstract class contains only abstract functions
(d) an abstract class contains only abstract functions
An abstract data type (ADT) has all of the following EXCEPT (a) a name (b) a set of data elements (c) a set of operations (d) an implementation
(d) an implementation
The loop invariant must be true at all of the following items EXCEPT (a) at the beginning of each repetition of the loop (b) after exiting the loop (c) before loop execution begins (d) during loop execution
(d) during loop execution
Which of the following most closely describes the functionality of a debugger? (a) it sweep your code and fixes bugs it encounters (b) it allow you to run your code directly from the IDE (c) it underlines in red all the parts of the program that are syntactically incorrect (d) it allows you to monitor the variables at individual steps during the execution of the program
(d) it allows you to monitor the variables at individual steps during the execution of the program
Which of the following CANNOT be overloaded? (a) << operator (b) <= operator (c) == operator (d) the dot operator
(d) the dot operator
Streams are used for input and output. What else? (a) the console is represented by input stream can and output stream out (b) you can declare your own input (or output) streams as type ifstream (or ofstream) objects (c) class istringstream extends stream to extract from a string (d) output files can be formatted using I/O manipulators (e) All of the above
(e) All of the above.
With an iterator named item, how would the data in the iterator be accessed?
*iter
Variable names valid in C++
-must all begin with a letter OR underscore -no spaces or special characters but can use #s -cannot use a c++ keyboard as a variable name
Quicksort is a stable sort (T of F)
False
To restore the AVL properly after inserting a element, we start at the insertion point and move towards root of that tree (T or F)
False (move from root of tree down)
What is the fundamental flaw with the Waterfall software development model?
It assumes that each stage can be completed correctly and fully before advancing to the next stage
If N = size / 2 and M = size * size, what is the Big-O of the following: for(i = 0; i < N; I++){ //sequence of statements } for(j = 0; j < M; j++){ //sequence of statments }
O(n^2)
What merges include file into the source file?
Preprocessor
For which type of error are try and catch most appropriate?
Run-time errors
Which of the following describes testing the smallest testable piece of the software?
Unit testing
C++ Concept
a c++ concept serves as a constraint by limiting the set of arguments that are accepted as template parameters
What best describes a C++ template?
a class template is a cookie cutter for a description of how to build a family of classes that all look basically the same
What kind of pointer should be included in a single linked node?
a pointer to the next node
What is true of shell and/or merge sorts? a. A merge sort is a stable sort b. A merge sort is faster than a shell sort(on average) c. A shell sort is a stable sort d. merge and shell sorts sort in place
a. A merge sort is a stable sort
How can you verify that a list is sorted? a. Check each element in the list and make sure that it is not less than is predecessor b. Check several random indices and ensure that they are in order c. Verify that each position in the list has its index and its value (e.g. spot 0 in the array is 0) d. any of the above
a. Check each element in the list and make sure that it is not less than is predecessor
Which is the worst case performance of bubble sort? a. Finding the largest chunk of the sorted list, and then sorting afterward b. Gradually shifting larger items to the back of the array, or smaller items to the front c. Picking the smallest item and moving it to the front of the list until the list is sorted d. Placing each item into the correct position in the list one at a time, like a hand of cards
a. Finding the largest chunk of the sorted list, and then sorting afterward
Let H(value) be a function that returns the hash code of "value". If A == B then a. H(A) == H(B) b. H(A) != H(B) c. H(A) may be equal to H(B) but it is not likely because it is random d. there is no known relation between H(A) and H(B)
a. H(A) == H(B)
What is the expected run-time for inserting into a hash table? a. O(1) b. O(n) c. O(log n) d. O(n*log n)
a. O(1)
What is the best case performance of the quick sort algorithm? a. O(n) b. O(n^2) c. O(n log n) d. O(log n)
a. O(n)
Which of the following most accurately describes the heap sort algorithm? a. Placing every item into a heap and moving the top item into the sorted list b. sorting the first element, and then adding items from the rest of the list recursively b. splitting the array evenly in half, and sorting the halves recursively d. splitting the array in halves based on size, and sorting the halves recursively
a. Placing every item into a heap and moving the top item into the sorted list
A Red-Black tree may not be as balanced as an AVL tree for the same series of inputs a. True b. False
a. True
Is it possible to have all black nodes in a Red-Black tree? a. Yes, with a tree of one node b. No, the root is always red c. Yes, a red node always has black children d. No, the number of black nodes is even
a. Yes, with a tree of one node
Balance, in the context of AVL trees, refers to_____ a. the difference between the heights of the right and left nodes b. the difference between the heights of the right node and the root node c. the difference between the number of nodes from the root to right and left nodes d. the difference between the number of nodes to the right and left of the node
a. the difference between the heights of the right and left nodes
What would be the Big-O of a reserve function which creates a new array that is twice the size of the current array for an object of class Vector and copies the contents form the old array into the new array?
amortized order 1
The "order of complexity" of an algorithm expresses
approximately how fast it can be expected to execute
What is the difference between const and the pre-processor directive #define?
as a general rule you should give the compiler preference to the preprocessor
Big-O for find, insert, and erase when having should be ___, ___, and ____, respectively a. log n, log n, log n b. 1, 1, 1 c. log n, 1, 1 d. 1, log n, log n
b. 1, 1, 1
Set A has 10 members and set B has 14 members. The intersection of the two sets has 5 members. How many members are in the union of the two sets? a. 10 b. 19 c. 14 d. 24
b. 19
In this sequence, 11 4 20 45 32 60 98 70, which element seems to be the pivot? a. 4 b. 20 c. 70 d. 98
b. 20
What is the maximum height of a Red-Black Tree with 7 nodes? a. 2 b. 3 c. 4 d. 7
b. 3
What is the maximum height of an AVL-tree with 7 nodes? (assume the height of the tree with a single node is 1) a. 2 b. 3 c. 4 d. 5
b. 3
suppose set A contains the strings "apples", "oranges", and "pineapples". Then the strings "apples" and "grapes" are inserted. How many are in A after these two insertions? a. 3 b. 4 c. 5 d. no way to be sure
b. 4
Shell sort can be interpreted as an improved version of which sorting algorithm? a. Bubble sort b. Insertion sort c. Selection sort d. Merge sort
b. Insertion sort
What is the worst case performance of bubble sort? a. O(n) b. O(n^2) c. O(n^3) d. O(n) exchanges, O(n^2) comparison
b. O(n^2)
Which of the following most accurately describes the shell sort algorithm? a. Shell sort is divide-and-conquer approach to bubble sort b. Shell sort sorts one smaller subarray using inserting sort before sorting the entire array c. After each subarray sort, a new subarray with approximately the same number of elements is sorted d. The last step is to perform an insertion sort on the entire array, which has been presorted by the earlier sorts
b. Shell sort sorts one smaller subarray using inserting sort before sorting the entire array
What is the difference between sort and stable_sort? a. Stable_sort is less likely to crash your program b. Stable_sort will preserve ordering of duplicate items c. Stable_sort is slightly faster d. They are identical
b. Stable_sort will preserve ordering of duplicate items
Which of the following is NOT an invariant of a Red-Black tree? a. A node is either red or black? b. The root is always red c. A red node always has black children d. The number of black nodes in any path from the root to the leaf is the same
b. The root is always red
The merge step of the merge sort depends on which of the following characteristics? a. The original array was of an even length b. The subarrays are sorted c. The two subarrays are relatively small d. The two subarrays are the same size
b. The subarrays are sorted
While inserting sort is generally O(n^2), it is ______ a. always O(n^2) b. sometimes O(n) c. sometimes O(n*log n) d. sometimes O(n^2 * log n)
b. sometimes O(n)
What is "chaining"? a. keeping track of the locations visited by particular item in a hash table when finding collisions b. storing a linked list in each table entry that contains each value that hashes to the same location c. the process of checking for open spots in a hash table if there is a collision d. the process of cleaning up a hash table that has had too many collisions
b. storing a linked list in each table entry that contains each value that hashes to the same location
What is true about the main function? a. command line parameters are passed through three arguments to the main() function b. The 1st parameter of main() is the number of arguments and the 2nd is an array of char* pointers to those arguments c. The main() function parameters are always called arg and arg d. the main() function parameters are required even when they are not used
b. the 1st parameter of main() is the number of arguments and the 2nd is an array of char* pointers to those arguments
Unlike a vector, a set does not support the subscript operator. If someone still wanted to iterate through each item in a set, they should a. use a vector instead, it cannot be done b. use an iterator c. use the at() function d. use the toString() function an dread the resulting string
b. use an iterator
Why is Node typically defined as a struct in the private part of the host class?
because a struct's data members are public by default
Both the client and programmer can do ______ testing. Typically only the ______ does _______ testing
black box; programmer; white box
What are the correct intermediate steps of the following data set when it is being sorted with the quick sort? 15, 20, 10, 18 a. 10, 20, 15, 18 -- 10, 15, 20, 18 -- 10, 15, 18, 20 b. 10, 20, 15, 18 -- 10, 18, 15, 20 -- 10, 15, 18, 20 c. 15, 10, 20, 18 -- 10, 15, 20, 18 -- 10, 15, 18, 20 d. 15, 20, 10, 18 -- 15, 10, 20, 18 -- 10, 15, 20, 18
c. 15, 10, 20, 18 -- 10, 15, 20, 18 -- 10, 15, 18, 20
A left-right AVL imbalance calls for _____ rotation(s), a right-right imbalance calls for ____ rotation(s) to correct the immediate imbalance a. 1 or 2, 1 or 2 b. 2 or more, 1 or more c. 2, 1 d. 1, 2
c. 2, 1
Which of the following can help to reduce collisions in a hash table? a. expanding the table size b. using quadratic probing instead of linear probing c. A and B d. None of the above
c. A and B
What are characteristics of a good pivot int he quick sort algorithm? a. It does not matter, all pivots are equally effective b. It is close to the mean value of the list c. It is close to the median value of the list d. It is either very large or very small compared to the rest of the list
c. It is close to the median value of the list
The Big-O of the number of exchanges of selection sort it_____. The Big O of the comparisons is_____ a. O(n), O(n) b. O(n^2), O(n^2) c. O(n), O(n^2) d. O(n), O(1)
c. O(n), O(n^2)
Quicksort uses a. Insertion b. Merging c. Partitioning d. Selection
c. Partitioning
"Divide-and-conquor" refers to a. the list being divided into sublists with equal numbers of elements in each then those sorted sublists are merged back together b. The list being divided into only two sublists, never more or less, which are sorted and merged back together c. The list being divided into smaller sublists, then those sorted sublists are merged back together
c. The list being divided into only two sublists, never more or less, which are sorted and merged back together
What do Red-Black trees, 2-3-4 trees, and AVL trees all have in common? a. They all are binary search trees b. They all have binary search tree c. They are all self balancing trees d. They are all largely unused--binary search trees are superior
c. They are all self balancing trees
What types of maps would NOT be useful in a Huffman Code algorithm? a. a map of characters to ints, representing the frequencies of each character b. a map of characters to strings, representing the encoding of each character c. a map of strings to characters, representing the decodings of each string d. all of the above are useful
c. a map of strings to characters, representing the decodings of each string
When using a map to implement a phone directory, the _____ should be the key and the ____ should be the value a. hash code, name b. hash code, phone number c. name, phone number d. phone number, name
c. name, phone number
Which of the following most accurately describes the merge sort algorithm? a. Placing every item into a heap and moving the top item into the sorted list b. Splitting the array evenly in half, and sorting the halves recursively c. Splitting the array in halves based on size, and sorting the halves recursively d. sorting the first element, and then adding items from the rest of the list recursively
c. splitting the array in halves based on size, and sorting the halves recursively
A map consists of a set of keys, each with one or more values. Which typically is/are unique? a. both b. neither c. the keys d. the values
c. the keys
Principle advantage of template class
can be used with any data type
What is the proper relationship between class List and class Ordered_List?
class Ordered_List has-a List
What is the primary advantage of heap sort over merge sort? a. Heapsort is easier to visualize b. Heapsort is significantly faster than heapsort c. Heapsort is stable, while merge sort is unstable d. Heapsort requires less space than merge sort
d. Heapsort requires less pace than merge sort
Which of the following most accurately describes the selection sort algorithm? a. Finding the largest chunk of the sorted list, and then sorting afterward b. Gradually shifting larger items to the back of the array, and smaller items of the front c. Placing each item into the correct position in the list one at a time, like a hand of cards d. Picking the smallest item and moving it to the front of the list until the list is sorted
d. Picking the smallest item and moving it to the front of the list until the list is sorted
Which of the following most accurately describes the insertion sort algorithm? a. Finding the largest chunk of the sorted list, and then sorting afterward b. Gradually shifting larger items to the back of the array, or smaller items to the front c. Picking the smallest item and moving it to the front of the list until the list is sorted d. Placing each item into the correct position in the list one at a time, like a hand of cards
d. Placing each item into the correct position in the list one at a time, like a hand of cards
Which of the following most accurately describes the quick sort algorithm? a. Placing every item into a heap and moving the top item into the sorted list b. Sorting the first element and then adding items from the rest of the list recursively c. Splitting the array evenly in half, and sorting the halves recursively d. Splitting the array in halves based on size, and sorting the halves recursively
d. Splitting the array in halves based on size, and sorting the halves recursively
Which of the following is true about the selection sort? a. Each element is examined only once b. It is one of the most complex sorting algorithms c. The code executes in O(n) time is the elements are sorted already d. With each pass, an element jumps to its final location
d. With each pass, an element jumps to its final location
What kind of mapping is used from keys to values? a. one-to-many b. one-to-one c. many-to-many d. many-to-one
d. many-to-one
If you wanted to use a data structure to store a club roster, which of the following should you use? a. either a map or a set, either is equally fine b. map c. neither a map nor a set will perform will here d. set
d. set
Suppose you want to traverse a hash table of names in alphabetical order. How would you do that? a. use an iterator b. use the remove operator c. use the subscript operator or the at() function d. this cannot be done
d. this cannot be done
What is C++ object delegation?
delegation allows exposer to some functionality of a pre-exsistying class, but still control access through your own interface
What is NOT TRUE about switch statements (a) every case needs to contain a break (b) it is not required that each case be enclosed in braces (c) the expression used in a switch statement must have an integral or enumerated type (d) when a break statement is reached, control jumps to the next line following the switch statement
every case needs to contain a break
what makes a class abstract?
has at least one pure virtual function (which must always be overridden)
External Functions
int f(); OR int X::f();
Software practitioners sometimes object to the term "bugs" because
it tends to trivialize potentially serious consequences of program defects
What is the principal advantage of a template class?
its ability to contain different types of data(determined at compile time)
What are use cases?
lists of user actions and system responses
________ errors probably exist in a significant portion of commercial software
logic
To ensure that the derived class destructor gets called before any base call destructors...
make the base class's destructor a pure virtual function
To ensure that the derived class destructor gets called before any base class destructors...
make the base class's destructor a pure virtual function
What can be done with a vector but not with an array created at compile time?
modify the size
Inserting at the head of a single-linked list is _____ inserting at the tail
more efficient than
A vector is _____ efficient than an array ______.
more, in terms of coding time, but not execution time or memory usage
In what order should catch clauses appear?
most specific to most general
in what order should catch clauses appear?
most specific to most general
overloading functions
multiple definitions of a function by changing the signature (the number of parameters)
As a first guess, the order of complexity of three nested loop is probably
n^3
What is the Big O of a program which has (i) a nested loop inside a nested loop and the innermost loop has 2 simple statements, (ii) a nested loop with 2,000 simples statements inside the inner loop, and (iii) a loop with 20,000 simple statements
n^3
What is the difference between new and malloc?
new: memory allocated from "free storage", returns a pointer, never returns a NULL (will throw failures) malloc: memory allocated from "heap", returns a void, returns NULL on failure
where can private data members be accessed?
only accessed directly within a class
If one class has two functions with the same name, but that take different arguments, this is an example of
overloading
Order of c++ tool chain
preprocessor, compiler, assembler, linker
The serration of what is to be done from how it is done is called
procedural abstraction
overriding functions
redefinition of a base class (abstract to concrete)
Which type of error are try and catch most appropriate?
run-time
In a class that contains a pointer to a dynamically allocated int, the destructor _____ deleter the pointer because _______
should, the memory pointed to but the pointer must be feed to prevent memory leaks
What is regression testing?
testing to make sure a change did not have an unintended consequence
arg & arg variables are...
the arguments for main function EX: int main(int argc, char* argv[]){ }
Base classes with derived classes
the derived class inherits all properties of the base class
Test cases are best built by identifying and testing
the failures and successes of functions
When collisions are resolved using linear probing.... a. infinite loop regularly result b. probing terminates not later than the end of the hash table c. the insertion occurs at the first available slot that was not previously occupied d. the insertion occurs at the first available slot, even it was previously occupied
the inserting occurs at the first available slot that was not previously occupied
What typically happens as a consequence of the "++iter" component of for(list <Item_Type>::iterator item = a_list.begin(); iter != a_list.end(); ++iter){ //sequence of statements }
the iterator pointer advances to the next element of the list
What is the difference between variable scope and lifetime?
the lifetime of an object is the potion of program execution during which storage is guaranteed to be reserved for it
What happens if an exception is thrown in a program and not caught?
the program aborts
Why is the list class require to have a push_front function, but the vector is not?
the push_front function would be O(n), and the functions must be at least amortized constant time to be required
data abstraction
the reduction of a body of data to a simplified representation
True or false: C++ has a sort function built in, so that you do not have to write your own every time you want to sort a list
true
The ______ model does not allow you to revisit previous stages of the software life cycle; the _____ model does allow stages to be revisited
waterfall, unified software life cycle
Suppose we are writing a program with polymorphism, but only our base class functions are being called! What is likely the source of our bug?
we have forgotten to make our base class functions virtual
What is the output of the following code fragment? double d = 53.12345; cout << set precision(3) << "|"; cout << left << fixed << set fill(' - '); cout << setw(10) << d << "|" << endl;
|53.123----|