CAPP 11686

subject Type Homework Help
subject Pages 15
subject Words 1592
subject Authors D. S. Malik

Unlock document.

This document is partially blurred.
Unlock all pages and 1 million more documents.
Get Access
page-pf1
We use ____ to implement mergesort.
a. recursion
b. iteration
c. revision
d. succession
The syntax for accessing a class (struct) member using the operator -> is ____.
a. pointerVariableName.classMemberName
b. pointerVariableName->classMemberName
c. pointerVariableName&->classMemberName
d. &pointerVariableName.classMemberName
A binary search can be performed only on ____.
a. unordered lists
b. arrays
c. comparable lists
page-pf2
d. ordered lists
On average, quicksort is of the order ____.
a. O(nlog2n)
b. O(n)
c. O(n2)
d. O(1)
To use a deque container in a program, the program must include the statement ____.
a. #include <queue>
b. #include <queues>
c. #include <deque>
d. #include <STL>
page-pf3
In a ____, customers or jobs with higher priority are pushed to the front of the queue.
a. double queue
b. false queue
c. free queue
d. priority queue
The algorithms reverse, reverse_copy, rotate, and rotate_copy are contained in the
header file ____.
a. utility
b. structures
c. algorithm
d. operations
page-pf4
The listing of the nodes produced by the preorder traversal of a binary tree is called the
____.
a. preorder sequence
b. postorder sequence
c. inorder sequence
d. variable sequence
In C++, a function name without any parentheses is considered a ____.
a. reference to the function
b. address of the function
c. pointer to an entry point
d. pointer to the function
A ____ is a list in which each element contains a key, such that the key in the element at
position k in the list is at least as large as the key in the element at position 2k + 1 (if it
exists) and 2k + 2 (if it exists).
a. hash table
page-pf5
b. hemp
c. heap
d. pile
Building a linked list backward places the item to be added at the ____ of the linked
list.
a. beginning
b. end
c. middle
d. key point
In the random probing method, the ith slot in the probe sequence is ____.
a. (h(X) % HTSize) + ri
b. (h(X) + HTSize) % ri
c. (h(X) % ri) + HTSize
d. (h(X) + ri) % HTSize
page-pf6
A B-tree can be ____ in three ways: inorder, preorder, and postorder.
a. copied
b. reversed
c. traversed
d. inversed
The algorithm ____ counts the occurrences of a given value in a given range.
a. count
b. reverse
c. index
d. rotate
page-pf7
When an item is deleted from the hash table indexStatusList at position, say k, we set
indexStatusList[k] to ____.
a. -1
b. 0
c. 1
d. 2
____ lists have elements that are arranged according to some criteria.
a. Structured
b. Unstructured
c. Random
d. Sorted
If a class contains the default constructor and no values are specified when the object is
declared, the ____ executes and initializes the object.
a. default destructor
page-pf8
b. first destructor in the program listing
c. last constructor in the program listing
d. default constructor
In an undirected graph, the edges are drawn using ____.
a. circles
b. lines
c. arrows
d. triangles
In an ordered linked list, the search algorithm is somewhat improved because the list is
____.
a. larger
b. smaller
c. referenced
d. sorted
page-pf9
In single inheritance, the derived class is derived from ____base class(es).
a. one
b. two
c. three or more
d. virtual
A(n) ____ definition is a definition in which something is defined in terms of a smaller
version of itself.
a. iterative
b. general
c. non-standard
d. recursive
page-pfa
Because initially the list is empty, the pointer first must be initialized to ____.
a. NULL
b. EMPTY
c. NIL
d. NOP
A ____ is a path of nonzero length from a vertex u to u with no repeated edges.
a. cycle
b. unit of work
c. circuit
d. transit
The function ____ returns a pointer to the last element into a container.
a. rbegin
b. beginr
page-pfb
c. rend
d. endr
In double hashing, if a collision occurs at h(X), the probe sequence is generated by
using the rule: ____
a. (h(X) + i * g (X)) % HTSize
b. (h(X) * i * g (X)) % HTSize
c. (h(X) * i + g (X)) % HTSize
d. (h(X) % i + g (X)) % HTSize
Let x be a node in a binary tree, then we say that the node x violates the ____ if |xh " x1|
> 1, that is, the heights of the left and right subtrees of x differ by more than 1.
a. balance criteria
b. balance factor
c. rebalance criteria
d. rebalance factor
page-pfc
A doubly linked list is a linked list in which every node has a next pointer and a ____
pointer.
a. back
b. center
c. null
d. binary
By default, all members of a class are ____.
a. public
b. protected
c. private
d. open
page-pfd
The breadth first traversal of a graph is similar to traversing a binary tree ____.
a. node-by-node
b. branch-by-branch
c. root-to-leaf
d. level-by-level
Every recursive call requires the system to allocate memory space for its ____ and local
variables.
a. formal parameters
b. informal parameters
c. global values
d. register values
The STL provides the class template ____, where the data type of the queue elements is
specified by elemType.
a. priority_queue<elemType>
page-pfe
b. prio_queue<elemType>
c. queue<elemType>
d. queue<elemType>.priority
Variables that are created during program execution are called ____ variables.
a. stack
b. heap
c. dynamic
d. static
The algorithm ____ is used to randomly order the elements in a given range.
a. reorder_shuffle
b. shuffle
c. order_shuffle
d. random_shuffle
page-pff
A linked list is not a random access data structure such as a(n) ____.
a. stack
b. deque
c. structure
d. array
A precondition is a statement specifying the condition(s) that must be true before the
function is called.
The function copy can copy the elements of a vector into another vector.
page-pf10
Operations, such as finding the height, determining the number of nodes, checking
whether the tree is empty, tree traversal, and so on, on AVL trees cannot be
implemented the same way they are implemented on binary trees.
The algorithm count_if counts the occurrences of a given value in a given range
satisfying a certain criterion.
The time-complexity of the copyStack function is O(1).
page-pf11
The operation pop returns the top element of the stack.
The members of a class are classified into three categories: private, public, and main.
To insert an item in an AVL tree, first we search the tree and find the place where the
new item is to be inserted.
To design a recursive function, you must determine the limiting conditions.
page-pf12
Insertion sort cannot be applied to linked lists.
Polymorphism is the ability to use the same expression to denote different operations.
In multiple inheritance, the derived class is derived from more than one base class.
The function that overloads any of the operators (), [], ->, or = for a class must be
page-pf13
declared as a member of the class.
Vector containers are logically the same as arrays.
A postcondition is a statement specifying what is true before the function call is
completed.
To implement the insertion algorithm in a B-tree, we only need algorithms to split a
node and insert an item into a node.
page-pf14
An edge incident on a single vertex is called a degree.
Prior to the addQueue operation, the queue must exist and must not be empty.
The expression vecCont.empty() empties the vector container of all elements.
In C++, the mechanism that allows you to combine data and the operations on that data
in a single unit is called a class.

Trusted by Thousands of
Students

Here are what students say about us.

Copyright ©2022 All rights reserved. | CoursePaper is not sponsored or endorsed by any college or university.