COSC 22323

subject Type Homework Help
subject Pages 13
subject Words 1520
subject Authors D. S. Malik

Unlock document.

This document is partially blurred.
Unlock all pages and 1 million more documents.
Get Access
page-pf1
____ use a looping structure, such as while, for, or do. . .while, to repeat a set of
statements.
a. Recursive control structures
b. Iterative control structures
c. Sequential control structures
d. Decisions structures
In the STL container list, the function pop_front ____.
a. inserts element at the beginning of the list
b. inserts element at the end of the list
c. returns the first element
d. removes the first element from the list
There are two types of AVL tree rotations: ____.
a. left rotation and right rotation
b. inner rotation and outer rotation
page-pf2
c. inner rotation and left rotation
d. right rotation and left inversion
The process of solving a problem by reducing it to smaller versions of itself is called
____.
a. iteration
b. succession
c. recursion
d. repulsion
The function ____ makes an identical copy of a stack.
a. readStack
b. buildStack
c. clearStack
d. copyStack
page-pf3
The ____ in a binary tree is the number of branches on the path from the root to the
node.
a. depth of a node
b. height of a tree
c. size of a node
d. level of a node
The function remove is used to remove the elements from a sequence by using some
criteria.
____ are systems in which queues of objects are waiting to be served by various
servers.
a. Queuing networks
page-pf4
b. Queuing systems
c. Holding systems
d. Standby systems
A ____ is a path in which all the vertices, except possibly the first and last vertices, are
distinct.
a. simple path
b. first path
c. complex path
d. best path
To guarantee that the instance variables of a class are initialized, you use ____.
a. friend functions
b. constructors
c. void functions
d. destructors
page-pf5
The ____ iterators are used to output data from a program into an output stream.
a. ostream
b. istream
c. iostream
d. ifstream
In the function ____, the growth rate is a function of the base 2 logarithm of n.
a. g(n)=1
b. g(n)=log2n
c. g(n)=nlog2n
d. g(n)=2n
page-pf6
A function is called ____ recursive if it calls itself.
a. indirectly
b. implicitly
c. apparently
d. directly
To determine whether the item to be inserted is already in the list, the insert function
calls the _____ member function.
a. isEmpty
b. size
c. seqSearch
d. copy
In mergesort, most of the sorting work is done in ____.
a. dividing the lists
page-pf7
b. sorting the sublists
c. calculating the division points
d. merging the sorted sublists
If the queue is nonempty, the operation ____ returns the last element of the queue and
so the element of the queue indicated by the pointer queueRear is returned.
a. front
b. middle
c. near
d. back
The effect of the expression rAccessIterator - n is that it ____.
a. deletes the nth element of the iterator
b. returns the iterator of the next nth element
c. returns the iterator of the previous nth element
d. moves rAccessIterator backwards n elements
page-pf8
The constructor without parameters is called the ____.
a. helper function
b. default constructor
c. destructor
d. default destructor
In a sequential search, if the search item is the first element of a list, we make ____
comparison(s).
a. one
b. two
c. three
d. n
page-pf9
____ containers are implemented as dynamic arrays in such a way that the elements can
be inserted at both ends.
a. Queue
b. Deque
c. Stack
d. Hash table
When a function is called, ____ is allocated for its formal parameters and local
variables.
a. nothing
b. memory space
c. global space
d. heap space
The solutions generated by the backtracking algorithm can be best represented by a(n)
____.
page-pfa
a. list
b. record
c. tree
d. array
In the late 1950s, the Australian philosopher and early computer scientist Charles L.
Hamblin proposed a scheme in which the operators follow the operands (postfix
operators), resulting in the ____ notation.
a. Inverse Polish
b. Inverted Roman
c. Reverse Polish
d. Reverse Arabic
A queue is a ____ data structure.
a. Last In First Out
b. First In First Out
c. Last In Last Out
page-pfb
d. First In Last Out
The height of a perfectly balanced binary tree with n nodes is ____.
a. logn
b. n2
c. nlogn
d. log2n
The binary search algorithm uses the ____ technique to search the list.
a. divide-and-conquer
b. divide-and-divide
c. conquer-and-resign
d. divide-and-resign
page-pfc
The general syntax to include the copy constructor in the definition of a class is ____.
a. className(className& otherObject);
b. className(className otherObject);
c. className(const className& otherObject);
d. className(const className* otherObject);
The default ordering criterion for the elements in an associative container is the
relational operator ____.
a. >=
b. <=
c. >
d. <
page-pfd
If the postfix expression is error free, the function ____ outputs the result.
a. printResult
b. pop
c. push
d. readResult
If p is a pointer variable of type int, then the statement ____ copies the value of list into
p.
a. list = p;
b. p.copy(list);
c. p->copy(list);
d. p = list;
A tree in which a particular vertex is designated as a root is called a ____ tree.
a. anchored
b. leaved
page-pfe
c. spanned
d. rooted
From the binary search algorithm, it follows that every iteration of the while loop cuts
the size of the search list by half.
The general case in a recursive function is the case for which the solution is obtained
directly.
Redefining a member function is the same as overloading the member function.
page-pff
The STL provides four insert iterators to insert elements at a destination.
When a dynamic variable is no longer needed, it can be destroyed; that is, its memory
can be deallocated.
The breadth first traversal algorithm is similar to traversing a binary tree level-by-level.
page-pf10
Default arguments can be used with an overloaded operator.
The rightmost bit of 33 is 2.
An iterator of the type const_iterator is a read-only iterator.
The only difference between the containers map and multimap is that the container map
allows duplicates, whereas the multimap container does not.
page-pf11
You can use stacks to convert recursive algorithms into nonrecursive algorithms,
especially recursive algorithms that are not tail recursive.
The usual operations on lists with header and trailer nodes are to initialize the list,
destroy the list, print the list, find the length of the list, search the list for a given item,
insert an item in the list, delete an item from the list,and copy the list.
How a graph is represented in computer memory depends on the specific application.
Nonmodifying algorithms do not modify the elements of the container.
page-pf12
We can traverse a singly linked list backward starting from the last node.
The main goal of a computer simulation is to either generate results showing the
performance of an existing system or predict the performance of a proposed system.
Elements can be inserted in the middle of a deque container.
page-pf13
A stack is a list of homogenous elements in which the addition and deletion of elements
occurs only at one end.
The copy constructor does not execute when the return value of a function is an object.

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.