CS303

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

In full binary search tree every internal node has exactly two children. If there are 100 leaf nodes in the tree, how many internal nodes are there in the tree?

99

T/F - An abstract class can be instantiated.

False

T/F - An iterative algorithm is simpler than a recursive algorithm and thus easier to write, code, debug, and read

False

T/F - Declaring the stand-alone function friend in the class definition will gives it the same rights as member functions, but will not have access to the private members of the class.

False

T/F - Trees have linear data organization

False

T/F - Usually in class definitions data fields are public and member functions are private.

False

T/F - When an exception is thrown, the normal flow of execution is not interrupted.

False

T/F - A user interacts with the Abstract Data Type (ADT) using only public methods.

True

T/F - Because only the front element of a queue is visible, the operations performed by a queue are few in number.

True

T/F - Because the value of n for each recursive case is smaller than the original value of n, each recursive case makes progress towards a base case

True

T/F - Protected visibility allows a derived class to directly access data fields declared in its base class.

True

T/F - To define a class completely, we must provide two things, a class definition and a class implementation.

True

During the _______________ phase of Waterfall model of the software life cycle, the requirements are studied and clarified, and the overall architecture of the solution is determined. a. Analysis b. Requirements c. Implementation d. Design

a. Analysis

Tree Traversals in which left subtree is visited before the root and root is visited before the right subtree is called __________________ traversal. a. Inorder b. Postorder c. Preorder d. None of the given options

a. Inorder

The goal of ________________ is to be able to access an entry based on its key value, not its location a. hash table b. set c. multiset d. map

a. hash table

Like the multiset, the multimap removes the restriction that the _________ are unique. a. keys b. values c. None of the given options d. both

a. keys

Look at the code of a function below : void set_birth_year(intbirth) { birth_year= birth; } This function : a. does not update the data field. b. is an example of modifier member function. c. is an example of accessor member function. d. returns the value of variable birth_year.

b. is an example of modifier member function

In a priority queue, just like a max heap, the___________ item is always removed first. a. last b. largest c. smallest d. middle

b. largest

Consider a function below (that determines whether each item in an array is unique). The total number of times the loop body of the innermost loop will execute is ______________ . bool are_unique(int x[], int x_length) {​ for(int i=0; i < x_length; i++) {​ for(int j=0; j < x_length; j++) {​ if (i != j && x[i] == x[j])​ return false;​ }​ }​ return true;​ } a. x.length b. x.length2 c. x.length - 1 d. x.length/2

b. x.length2

Having multiple member functions with the same name but different signatures in a class is called _________________. a. Polymorphism​ b. Member Function Overriding c. Member Function Overloading d. Inheritance

c. Member Function Overloading

___________ refers the ability of a class to extend more than one class. a. Function Overloading b. Inheritance c. Multiple inheritance d. Polymorphism​

c. Multiple inheritance

Which of the following problem cannot be solved using recursion? a. Tree Traversal b. Tower of Hanoi c. Problems without base case d. Fibonacci series

c. Problems without base case

A dequeue is ___________________________________________________________. a. a queue implemented with both singly and doubly linked lists b. a queue implemented with a doubly linked list c. a queue with insert/delete defined for both front and rear ends of the queue d. a queue with insert/delete defined for front side of the queue

c. a queue with insert/delete defined for both front and rear ends

If the details of a data object's implementation are hidden from the higher-level module (a C++ class), the higher-level class can access the data object only through its ___________________. a. angle brackets b. constructor c. member functions d. data members

c. member functions

A set is a collection that contains at most one ____________ element. a. indexed b. None of the given options c. null d. duplicate

c. null

The declarations for the functions with the keyword "const" immediately preceding the semicolon means that : a. the output of these functions is constant value. b. these functions control access to an object's data. c. these functions will not modify the object on which they operate. d. the client programmer can view the private declarations of these functions.

c. these functions will not modify the object on which they operate.

A queue follows __________ a. Ordered array b. LIFO (Last In First Out) principle c. Linear tree d. FIFO (First In First Out) principle

d. FIFO

____________ involves testing the interactions among units. This may involve testing interactions among functions in a class but generally involves testing interactions among several classes. a. System testing b. Unit Testing c. Acceptance testing d. Integration testing

d. Integration testing

For Binary Search Tree, the worst case searching complexity is ____________________. a. O(log n) b. O(n log n) c. O (1) d. O(n)

d. O(n)

Array index out of bound is an example of ________________ . a. Logic errors​ b. Syntax errors c. Typographical errors​ d. Run-time errors

d. Run-time errors

A fuller table results in __________ collisions. a. no b. equal c. less d. more

d. more

In a max-heap, element with the greatest key is always in the which node? a. Leaf node b. First node of right sub tree c. First node of left sub tree d. root node

d. root node


Ensembles d'études connexes

The point ch 18: assessing mouth, throat

View Set

MIdterm Practice: Chapters 6 - 11

View Set

Business Law: Chapter 35 - Employment Discrimination

View Set

The Scientific Method and Descriptive Research Methods// Chapter 1

View Set

Finance 427 Exam 1 (End of Chapter Questions)

View Set

Overview of Personality Disorders (Sherpath)

View Set

Version 21 exam/24 (50 questions) (level: EASY) *extra*

View Set

Nutrition Chapter 2 LearningCurve

View Set