AND STRUCTURED COMPUTER SCIENCE
OVERVIEW GUIDE
◉ A name defined in an outer scope is not available in all blocks
nested inside that scope. Answer: True
◉ Which keyword is used in Java to create an object?
none of these
create
build
make
new Answer: new
◉ Which object oriented element is best defined as "objects best
viewed as packages of responsibility"?
Data Hiding
Message Passing
Encapsulation
Polymorphism
Inheritance
none of these
,Composition Answer: Encapsulation
◉ We can more easily debug a program when the responsibilities
are well encapsulated. Answer: True
◉ A Queue is a First In First Out (FIFO) data structure. Answer: True
◉ The finally block of a try/catch structure will execute if no
exception occurs in the try block. Answer: True
◉ In a Binary Search Tree, all elements below a given a node have
values that are < that node's value. Answer: False
◉ Stacks can only be implemented as LinkedLists, while Queues can
only be implemented as ArrayLists. Answer: False
◉ In a Binary Search Tree, all elements to one side of a node are <
that node's value, and all elements to the other side are > that node's
value. Answer: True
◉ The finally block of a try/catch structure will execute if an
exception occurs in the try block. Answer: True
◉ Which of the following run-time complexity orders is best?
, O(log n) Logarithmic time
none of these
O(2^n) Exponential
O(n) Linear time Answer: none of these
◉ Which of the following would have a quadratic Big O run-time
complexity?
none of these
Bubble Sort an unsorted array
Insert a value into an ArrayList
Efficiently find the phone number in a phone book, given a person's
name
Determine if a binary number is even or odd Answer: Bubble sort
◉ Which of the following would have a quadratic Big O run-time
complexity?
Efficiently find the definition of a given word in a dictionary
Determine if a binary number is even or odd
none of these
Find the shortest route to visit n cities by airplane
Find the largest value in an unsorted list Answer: None of these