DATA STRUCTURES MIDTERM EXAM
QUESTIONS AND ANSWERS
Define the term data structure - Correct Answers -A data structure is basically a
container of information.. It is an organization of content or information that takes up
memory and allows efficient access.
Abstract Data Type - Correct Answers -a class, or objects where behavior is defined by
values and set of operations but have no implementation
What is a built-in data structure? - Correct Answers -storage mechanism that comes
with the programming language. For example, in Java, a built-in data structure is an
array or the Java String class.
What three criteria are used to determine whether a data structure is acceptable for a
particular application? - Correct Answers -1) cost 2) speed and 3) memory overhead.
Put the following terms in size order: node, field, data set - Correct Answers -The
smallest size is a field, followed by node and the largest is a data set
Two objects, objectA and objectB, are objects in the class Listing. The object objectA is
copied to objectB. How many objects exist after the copy, if the copy is performed as a
DEEP COPY? - Correct Answers -2 copies (actually makes a copy)
Of the two types of copies, which one produces a clone (an exact duplicate of an
existing object)? - Correct Answers -deep copy produces a clone
basic operations performed on data structures, and tell what each operation does. -
Correct Answers -Insert: adds a node to the first null array element in a data set
Delete: deletes a node and moves up all the nodes below it
Fetch: retrieves a node asked of the data set
Update: changes the information through combining "delete" and "insert" operations
Stacks have push/pop:
- Push: Essentially the insert function for a stack. It adds a node onto the top of the
stack. It cannot be performed on a full stack, causing an overflow error.
QUESTIONS AND ANSWERS
Define the term data structure - Correct Answers -A data structure is basically a
container of information.. It is an organization of content or information that takes up
memory and allows efficient access.
Abstract Data Type - Correct Answers -a class, or objects where behavior is defined by
values and set of operations but have no implementation
What is a built-in data structure? - Correct Answers -storage mechanism that comes
with the programming language. For example, in Java, a built-in data structure is an
array or the Java String class.
What three criteria are used to determine whether a data structure is acceptable for a
particular application? - Correct Answers -1) cost 2) speed and 3) memory overhead.
Put the following terms in size order: node, field, data set - Correct Answers -The
smallest size is a field, followed by node and the largest is a data set
Two objects, objectA and objectB, are objects in the class Listing. The object objectA is
copied to objectB. How many objects exist after the copy, if the copy is performed as a
DEEP COPY? - Correct Answers -2 copies (actually makes a copy)
Of the two types of copies, which one produces a clone (an exact duplicate of an
existing object)? - Correct Answers -deep copy produces a clone
basic operations performed on data structures, and tell what each operation does. -
Correct Answers -Insert: adds a node to the first null array element in a data set
Delete: deletes a node and moves up all the nodes below it
Fetch: retrieves a node asked of the data set
Update: changes the information through combining "delete" and "insert" operations
Stacks have push/pop:
- Push: Essentially the insert function for a stack. It adds a node onto the top of the
stack. It cannot be performed on a full stack, causing an overflow error.