0% found this document useful (0 votes)
9 views25 pages

Algorithm Analysis MCQ PDF

The document is an overview of an Algorithm Analysis course, detailing its focus on evaluating algorithms for efficiency and effectiveness, including concepts like time and space complexity. It includes 21 chapters with 1050 verified questions and study resources, covering various algorithmic paradigms and practical exercises. Recommended resources and sample questions from different chapters are also provided.

Uploaded by

l0xpanfdqi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views25 pages

Algorithm Analysis MCQ PDF

The document is an overview of an Algorithm Analysis course, detailing its focus on evaluating algorithms for efficiency and effectiveness, including concepts like time and space complexity. It includes 21 chapters with 1050 verified questions and study resources, covering various algorithmic paradigms and practical exercises. Recommended resources and sample questions from different chapters are also provided.

Uploaded by

l0xpanfdqi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Algorithm Analysis MCQ PDF

https://quizplus.com/study-set/319
21 Chapters
1050 Verified Questions
Algorithm Analysis
MCQ PDF
Cou
Algorithm Analysis delves into the systematic evaluation of algorithms to determine their

efficiency and effectiveness in solving computational problems. The course explores key

concepts such as time and space complexity, with an emphasis on Big O, Big Theta, and

Big Omega notations. Students will examine various algorithmic paradigms, including

divide and conquer, dynamic programming, and greedy algorithms, while analyzing the

trade-offs involved in their use. Through theoretical study and practical exercises, the

course cultivates a deep understanding of how to measure, compare, and improve

algorithm performance in diverse application contexts.

Recommended Textbook
C++ Programming Program Design Including Data Structures 6th Edition by D.S. Malik

Available Study Resources on Quizplus


21 Chapters
1050 Verified Questions
1050 Flashcards
Source URL: https://quizplus.com/study-set/319

Page 2
Chapter 1: An Overview of Computers and Programming

Languages
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/128444

Sample Questions
Q1) Main memory is called ____.
A) read only memory
B) random access memory
C) read and write memory
D) random read only memory
Answer: B

Q2) Several categories of computers exist,such as ____.


A) microframe, midframe, and miniframe
B) midsize, microframe, and mainframe
C) mainsize, midsize, and microsize
D) mainframe, midsize, and micro
Answer: D

Q3) Word processors,spreadsheets,and games are examples of


____________________.
Answer: application programs
applications

Q4) ____________________ signals represent information with a sequence of 0s


and 1s.
Answer: Digital
Page 3
digital

Q5) The ASCII data set consists of ____________________ characters.


Answer: 128
To view all questions and flashcards with answers, click on the resource link above.

Page 4
Chapter 2: Basic Elements of C++
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5305

Sample Questions
Q1) The ____________________ type is C++ 's method for allowing programmers to
create their own simple data types.
Answer: enumeration

Q2) ____________________ rules determine the meaning of instructions.


Answer: Semantic
semantic

Q3) A(n)____________________ is a sequence of zero or more characters.


Answer: string

Q4) The escape sequence \r moves the insertion point to the beginning of the next line.
A)True
B)False
Answer: False

Q5) The maximum number of significant digits is called the


____________________.
Answer: precision

Q6) A mixed arithmetic expression contains all operands of the same type.
A)True
B)False
Answer: False

Page 5
To view all questions and flashcards with answers, click on the resource link above.
Chapter 3: Input/Output
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5306

Sample Questions
Q1) Suppose that x = 55.68,y = 476.859,and z = 23.8216.What is the output of the following
statements?
cout << fixed << showpoint;
Cout << setprecision(3);
Cout << x << ' ' << y << ' ' << setprecision(2)<< z << endl;
A) 55.680 476.859 23.82
B) 55.690 476.860 23.82
C) 55.680 476.860 23.82
D) 55.680 476.859 23.821
Answer: A

Q2) You can use the function getline to read a string containing blanks.
A)True
B)False
Answer: True

Q3) In C++,the dot is an operator called the ____ operator.


A) dot access
B) member access
C) data access
D) member
Answer: B

To view all questions and flashcards with answers, click on the resource link above.
Page 6
Chapter 4: Control Structures I (Selection)
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5307

Sample Questions
Q1) What does <= mean?
A) less than
B) greater than
C) less than or equal to
D) greater than or equal to

Q2) Suppose found = true and num = 6.The value of the expression (!found)|| (num > 6)is
____________________.
A)True
B)False

Q3) The expression in an if statement is sometimes called a(n)____.


A) selection statement
B) action statement
C) decision maker
D) action maker

Q4) To output results correctly,the switch structure must include


a(n)____________________ statement after each cout statement,except the last
cout statement.

Q5) The operators != and == have the same order of precedence.


A)True
B)False
Page 7
To view all questions and flashcards with answers, click on the resource link above.
Chapter 5: Control Structures II (Repetition)
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/128467

Sample Questions
Q1) ____ loops are called posttest loops.
A) break
B) for
C) while
D) do...while

Q2) The function eof is a member of the data type ____________________.

Q3) Assume that all variables are properly declared.The following for loop executes 20
times.
for (i = 0; i <= 20; i++)
\(\quad\)cout << i;
A)True
B)False

Q4) What is the output of the following C++ code? num = 100;
while (num <= 150)
\(\quad\)num = num + 5;
cout << num << endl;
A) 150
B) 155
C) 160
D) 165

To view all questions and flashcards with Page 8 click on the resource link above.
answers,
Chapter 6: User-Defined Functions
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5309

Sample Questions
Q1) Given the following function:
int strange(int x,int y)
{
\(\quad\)if (x > y)
\(\quad\)\(\quad\)Return x + y;
else
\(\quad\)Return x - y;
}
What is the output of the following statement?
Cout << strange(4,5)<< endl;
A) -1
B) 1
C) 9
D) 20

Q2) What value is returned by the following return statement? int x = 5;


Return x + 1;
A) 0
B) 5
C) 6
D) 7

To view all questions and flashcards with answers, click on the resource link above.

Page 9
Chapter 7: User-Defined Simple Data Types, Namespaces,

and the string Type


Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5310

Sample Questions
Q1) Consider the declaration: enum sports
{BASKETBALL,FOOTBALL,HOCKEY,BASEBALL,SOCCER};
Which of the following statements is true?
A) SOCCER-- = BASEBALL
B) BASEBALL++ = SOCCER
C) HOCKEY + FOOTBALL < SOCCER
D) FOOTBALL <= SOCCER

Q2) In C++,____ is called the scope resolution operator.


A) \(.\)
B) \(?\)
C) :
D) ::

Q3) Consider the following statements: string str1 = "Gone with the wind";
String str2;
After the statement str2 = str1.substr(5,4); executes,the value of str2 is "____".
A) Gone
B) with
C) the
D) wind

Page 10
To view all questions and flashcards with answers, click on the resource link above.
Chapter 8: Arrays and Strings
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5311

Sample Questions
Q1) The statement strlen("Marylin Stewart"); returns ____________________.

Q2) Given the declaration int list[20]; the statement list[12] = list[5] + list[7]; updates the
content of the twelfth component of the array list.
A)True
B)False

Q3) Suppose that list is an array of 10 components of type int.Which of the following
codes correctly outputs all the elements of list?
A) for (int j = 1; j < 10; j++)
\(\quad\)\(\quad\)cout << list[j] << " ";
\(\quad\)cout << endl;
B) for (int j = 0; j <= 9; j++)
\(\quad\)\(\quad\)Cout << list[j] << " ";
\(\quad\)cout << endl;
C) for (int j = 1; j < 11; j++)
\(\quad\)\(\quad\)cout << list[j] << " ";
\(\quad\)cout << endl;
D) for (int j = 1; j <= 10; j++)
\(\quad\)\(\quad\)cout << list[j] << " ";
\(\quad\)cout << endl;

To view all questions and flashcards with answers, click on the resource link above.

Page 11
Chapter 9: Records (structs)
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5312

Sample Questions
Q1) If a variable is passed by ____________________,then when the formal
parameter changes,the actual parameter also changes.

Q2) Consider the accompanying struct definition.The statement that assigns the
average of testScore and programmingScore to score is ____________________.

Q3) You can declare struct variables when you define a struct.
A)True
B)False

Q4) Consider the accompanying struct definition in Figure 1.The statement that initializes
the member firstName to Melissa is ____________________.

Q5) A struct is a(n)____________________,not a declaration.

Q6) A(n)____________________ is a set of elements of the same type.

Q7) Consider the accompanying struct definition in Figure 1.The statement that initializes
the member testScore to 95 is ____________________.

Q8) A function can return a value of the type struct.


A)True
B)False

Q9) In C++,struct is a(n)____________________ word.


Page 12
Q10) Both arrays and structs are examples of ____________________ data types.

To view all questions and flashcards with answers, click on the resource link above.
Chapter 10: Classes and Data Abstraction
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/128469

Sample Questions
Q1) How many destructors can a class have?
A) no explicit destructors
B) one
C) two
D) any number

Q2) To guarantee that the member variables of a class are initialized,you use ____.
A) accessors
B) mutators
C) constructors
D) destructor

Q3) A ____ sign in front of a member name on a UML diagram indicates that this
member is a protected member.
A) +
B) -
C) #
D) $

Q4) A(n)____________________ is a statement specifying the condition(s)that


must be true before the function is called.

Q5) Classes were specifically designed in C++ to handle ____________________.

Q6) Object code is produced from a(n)____________________.


Page 13

To view all questions and flashcards with answers, click on the resource link above.
Chapter 11: Inheritance and Composition
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5314

Sample Questions
Q1) Which of the following statements about inheritance is true if
memberAccessSpecifier is protected?
A) The private members of the base class become protected members of the derived
class.
B) The derived class can directly access any member of the base class.
C) The public members of the base class become protected members of the derived
class.
D) The protected members of the base class become private members of the derived
class.

Q2) In C++,we implement ADT through the use of ____________________.

Q3) ____ is a "has-a" relationship.


A) Inheritance
B) Encapsulation
C) Composition
D) Polymorphism

Q4) Existing classes,from which you create new classes,are called ____ classes.
A) child
B) base
C) sibling
D) derived

To view all questions and flashcards withPage 14 click on the resource link above.
answers,
Chapter 12: Pointers, Classes, Virtual Functions, Abstract

Classes, and Lists


Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5315

Sample Questions
Q1) Which of the following would be appropriate syntax for the heading of a copy
constructor for a class called rulerType?
A) rulerType(int inches, int centimeters)
B) rulerType()
C) rulerType(const rulerType& myRuler)
D) copy rulerType(int inches, int centimeters)

Q2) Which of the following can be used to initialize a pointer variable?


A) 1
B) NULL
C) "0"
D) '0'

Q3) The code int *p; declares p to be a(n)____ variable.


A) new
B) num
C) pointer
D) address

Q4) The statement that declares board to be a pointer to a pointer is: int
____________________;

Q5) The ____________________ of Page 15the number of elements in the list.


a list is

Q6) The binding of virtual functions occurs at program ____________________


time.
To view all questions and flashcards with answers, click on the resource link above.

Page 16
Chapter 13: Overloading and Templates
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5316

Sample Questions
Q1) Which of the following is the general syntax of the function prototype to overload the
post-increment operator as a member function?
A) className operator++();
B) friend className operator++();
C) className operator++(int);
D) friend className operator++(int);

Q2) In C++,operator is a reserved word.


A)True
B)False

Q3) To overload the pre-increment (++)operator for a class,if the operator function is a
member of that class,it must have ____ parameter(s).
A) no
B) one
C) two
D) three

Q4) Both parameters of the function to overload the operator << are reference
parameters.
A)True
B)False

To view all questions and flashcards with answers, click on the resource link above.
Page 17
Chapter 14: Exception Handling
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5317

Sample Questions
Q1) The function ____ can check whether an expression meets the required conditions;
if the conditions are not met,it terminates the program.
A) check
B) look
C) assert
D) what

Q2) In a sequence of try/catch blocks,the last catch block of that sequence should be
____.
A) catch(...){ }
B) catch(int x){ }
C) catch(str){ }
D) catch(exception){}

Q3) When an exception is thrown,if the program does not handle the exception,then the
function ____ is called to terminate the program.
A) log
B) what
C) terminate
D) close

Q4) In C++,throw is a(n)____________________ word.

To view all questions and flashcards with answers, click on the resource link above.
Page 18
Chapter 15: Recursion
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5318

Sample Questions
Q1) ____ control structures use a looping structure,such as while,for,or do...while,to
repeat a set of statements.
A) Iterative
B) Recursive
C) Procedural
D) Object

Q2) Which of the following solution methods would be the best choice for a mission
control system?
A) Iterative
B) Direct recursive
C) Indirect recursive
D) Infinite recursive

Q3) In the Tower of Hanoi recursive program,if needle 1 contains three disks,then the
number of moves required to move all three disks from needle 1 to needle 3 is 8.
A)True
B)False

Q4) The collating sequence of A in the ASCII character set is


____________________.

Q5) The ____________________ bit of 33 is 1.

Q6) Recursive algorithms are implemented


Page 19 using ____________________
functions.

To view all questions and flashcards with answers, click on the resource link above.
Chapter 16: Linked Lists
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5319

Sample Questions
Q1) When you build a linked list in the backward manner,a new node is always inserted
at the end of the linked list.
A)True
B)False

Q2) How many pointers are needed to build a linked list in a backward manner?
A) One
B) Two
C) Three
D) Four

Q3) The deleteNode operation (if the item to be deleted is in a doubly linked list)requires
the adjustment of ____ pointer(s)in certain nodes.
A) one
B) two
C) three
D) four

Q4) For classes that include pointer data members,the assignment operator must be
explicitly ____________________.

Q5) A linked list in which the last node points to the first node is called
a(n)____________________ linked list.

To view all questions and flashcards withPage


answers,
20 click on the resource link above.
Chapter 17: Stacks and Queues
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5320

Sample Questions
Q1) The postfix expression 5 6 + 4 * 10 5 / - = evaluates to ____.
A) 10
B) 30
C) 42
D) 44

Q2) An array is a(n)____________________ access data structure.

Q3) The elements at the ____________________ of a stack have been in the stack
the longest.

Q4) In ____________________ notation,operators are written after the operands.

Q5) The ____________________ constructor is called when a stack object is


passed as a (value)parameter to a function.

Q6) The expression a + b is the same in both infix notation and postfix notation.
A)True
B)False

Q7) The expression (a - b)* (c + d)is equivalent to which of the following postfix
expressions?
A) a b c d - + *
B) a b - c d + *
C) a b - + c d *
Page 21
D) - + * a b c d

To view all questions and flashcards with answers, click on the resource link above.
Chapter 18: Searching and Sorting Algorithms
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5321

Sample Questions
Q1) In the average case,sequential search typically searches ____.
A) one quarter of the list
B) one third of the list
C) one half of the list
D) the entire list

Q2) A sequential search of an n-element list takes ____ key comparisons if the item is
not in the list.
A) 0
B) n/2
C) n
D) n<sup>2</sup>

Q3) The formula to find the index of the middle element of a list is ____.
A) (mid + last)/2
B) (first + last) - 2
C) (first + last) / 2
D) (first + mid ) * 2

Q4) A comparison tree is a(n)____________________ tree.

Q5) In the case of an unsuccessful search,it can be shown that for a list of length n,a
binary search makes approximately ____________________ key comparisons.

To view all questions and flashcards withPage


answers,
22 click on the resource link above.
Chapter 19: Binary Trees
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5322

Sample Questions
Q1) Let T be a binary search tree with n nodes,in which n > 0.The number of key
comparisons is approximately O(____________________).

Q2) The operations to do inorder,preorder,and postorder traversals of a binary search


tree are the same as those for a binary tree.
A)True
B)False

Q3) In a(n)____________________ traversal,the binary tree is traversed as follows:


1.Traverse the left subtree
2.Visit the node
3.Traverse the right subtree

Q4) The three traversal algorithms discussed for binary trees are ____,____,and ____.
A) order, preorder, postorder
B) in, preorder, order
C) order, preorder, post
D) inorder, preorder, postorder

Q5) After inserting an item in a binary search tree,the resulting binary tree must be
a(n)____________________.

To view all questions and flashcards with answers, click on the resource link above.

Page 23
Chapter 20: Graphs
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5323

Sample Questions
Q1) The two most common graph traversal algorithms are depth first traversal and
breadth first traversal.
A)True
B)False

Q2) A graph G is a pair,G = (V,E),where V is a finite nonempty set called the set of ____
of G,and the elements of E are the pairs of elements of V.
A) nodes
B) branches
C) vertices
D) edges

Q3) In a(n)____ graph,the edges are drawn using arrows.


A) pointed
B) vector
C) directed
D) undirected

Q4) A(n)____________________ ordering of the vertices of the accompanying


graph is 0,1,3,4,2,5,7,8,6,9.

Q5) A set Y is called a(n)____________________ of X if every element of Y is also an


element of X.

To view all questions and flashcards withPage


answers,
24 click on the resource link above.
Chapter 21: Standard Template Library (STL)
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5324

Sample Questions
Q1) Every container contains the typedef ____________________.An iterator of this
type is used to iterate through the elements of a container in reverse.

Q2) Every object in a(n)____ container has a specific position.


A) adapter
B) sequence
C) associative
D) static

Q3) The ____ typedef iterators is common to all containers.


A) random_access
B) bidirectional
C) pointer
D) forward

Q4) The vector container stores and manages its objects in a dynamic array.
A)True
B)False

Q5) ____________________ iterators are forward iterators that can also iterate
backward over the elements.

Q6) ____________________ predicates check a specific property for a single


argument.

Page 25
Q7) List containers are implemented as doubly ____________________.

To view all questions and flashcards with answers, click on the resource link above.

You might also like