CMPT 280 EXAM WITH COMPLETE SOLUTIONS 100% VERIFIED
ADT - Answer Specification of data and operations on that data that is free of
implementation details
Consists of:
• one or more data structures (i.e. a declaration of data);
• a set of publicly known operations on the data structure(s); and
• encapsulation (hiding) of the data structures and the implementation of the operations
Linked list - Answer lists implemented with a node chain
Regression testing - Answer Automated test program that is designed to uncover new
bugs (i.e. regressions) after code has been changed to make enhancements, fix bugs,
etc
Characteristics of a Good Regression Test - Answer Thorough testing
Easy to run
Easily expanded
True or false: regression testing includes testing where a method is called with an
argument of the wrong type - Answer False, the compiler is there to catch these types of
syntactical errors
∃ - Answer there exists
∀ - Answer for all
Big O set definition - Answer There must exist two constants, one called c, and one
, called n0 (which may be different values for different t (n)'s) , such that the statement t
(n) ≤ c f (n) is true for every value of n greater than or equal to n0
O(f(n)) = {t(n) | ∃c,n0 > 0 such that t(n) ≤ cf(n),∀n ≥ n0}
Collection - Answer a data structure that is comprised of a set of data elements in some
conceptual arrangement
If position is null and prevPosition is non-null what is the actual position - Answer after
If position is non-null and prevPosition is null what is the actual position - Answer first
item
If position is null, prevPosition is null and the number of items it >0 what is the actual
position - Answer before
If position is null, prevPosition is null and the number of items it 0 what is the actual
position - Answer before and after
What is the difference between a cursor and an iterator - Answer A cursor is property of
a collection, an iterator is a distinct object
True or false: cursors always provide public methods for iterating over all of the
elements in the collection - Answer False. Iterators always do, cursors can but does not
have to
What is the disadvantage of doubly-linked lists? - Answer they use more space
What are the advantages of doubly-linked lists? - Answer 1) insert and delete at
beginning and end in the list in constant time
2) can have cursors and iterators that can move forward and backward
ADT - Answer Specification of data and operations on that data that is free of
implementation details
Consists of:
• one or more data structures (i.e. a declaration of data);
• a set of publicly known operations on the data structure(s); and
• encapsulation (hiding) of the data structures and the implementation of the operations
Linked list - Answer lists implemented with a node chain
Regression testing - Answer Automated test program that is designed to uncover new
bugs (i.e. regressions) after code has been changed to make enhancements, fix bugs,
etc
Characteristics of a Good Regression Test - Answer Thorough testing
Easy to run
Easily expanded
True or false: regression testing includes testing where a method is called with an
argument of the wrong type - Answer False, the compiler is there to catch these types of
syntactical errors
∃ - Answer there exists
∀ - Answer for all
Big O set definition - Answer There must exist two constants, one called c, and one
, called n0 (which may be different values for different t (n)'s) , such that the statement t
(n) ≤ c f (n) is true for every value of n greater than or equal to n0
O(f(n)) = {t(n) | ∃c,n0 > 0 such that t(n) ≤ cf(n),∀n ≥ n0}
Collection - Answer a data structure that is comprised of a set of data elements in some
conceptual arrangement
If position is null and prevPosition is non-null what is the actual position - Answer after
If position is non-null and prevPosition is null what is the actual position - Answer first
item
If position is null, prevPosition is null and the number of items it >0 what is the actual
position - Answer before
If position is null, prevPosition is null and the number of items it 0 what is the actual
position - Answer before and after
What is the difference between a cursor and an iterator - Answer A cursor is property of
a collection, an iterator is a distinct object
True or false: cursors always provide public methods for iterating over all of the
elements in the collection - Answer False. Iterators always do, cursors can but does not
have to
What is the disadvantage of doubly-linked lists? - Answer they use more space
What are the advantages of doubly-linked lists? - Answer 1) insert and delete at
beginning and end in the list in constant time
2) can have cursors and iterators that can move forward and backward