100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

Computer Science II Final Exam Questions and Answers Latest Edition.

Rating
-
Sold
-
Pages
43
Grade
A+
Uploaded on
30-06-2025
Written in
2024/2025

Computer Science II Final Exam Questions and Answers Latest Edition.

Institution
Computer Science II
Course
Computer Science II











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Computer Science II
Course
Computer Science II

Document information

Uploaded on
June 30, 2025
Number of pages
43
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

  • c recursive

Content preview

Computer Science II Final Exam
Questions and Answers 2025-2026
Latest Edition.
A ________ function is one that calls itself

A) dynamic

B) static

C) recursive

D) data validation

E) None of these - ANS -C) recursive



Recursion can be used to:

A) compute factorials

B) find GCD's

C) traverse linked lists

D) All of these

E) None of these - ANS -D) All of these



The ________ algorithm uses recursion to efficiently sort a list.

A) shell sort

B) quicksort

C) binary sort

D) red/black sort

E) None of these - ANS -B) quicksort

,If a recursive function does not contain a base case, it ________.

A) returns 0 and stops

B) returns false and stops

C) uses up all available stack memory, causing the program to crash

D) reaches the recursive case and stops

E) None of these - ANS -C) uses up all available stack memory, causing the program to crash



The ________ of recursion is the number of times a recursive function calls itself.

A) level

B) breadth

C) type

D) depth

E) None of these - ANS -D) depth



The programmer must ensure that a recursive function does not become:

A) a static function

B) a virtual function

C) an endless loop

D) a dynamic function

E) None of these - ANS -C) an endless loop



How many times will the following function call itself, if the value 5 is passed as the argument?



void showMessage(int n)

{

if (n > 0)

,{

cout << "Good day!" << endl;

showMessage(n + 1);

}

}



A) 1

B) 4

C) 5

D) An infinite number of times - ANS -D) An infinite number of times



How many times will the following function call itself, if the value 5 is passed as the argument?



void showMessage(int n)

{

if (n > 0)

{

cout << "Good day!" << endl;

showMessage(n - 1);

}

}



A) 1

B) 4

C) 5

D) An infinite number of times - ANS -C) 5

, The QuickSort algorithm works on the basis of

A) three sublists

B) two sublists and a pivot

C) two pivots and a sublist

D) three pivots

E) None of these - ANS -B) two sublists and a pivot



A recursive function is designed to terminate when it reaches its ________.

A) return statement

B) base case

C) closing curly brace

D) last parameter

E) None of these - ANS -B) base case



When function A calls function B, which in turn calls function A, this is known as:

A) direct recursion

B) indirect recursion

C) function swapping

D) perfect recursion

E) None of these - ANS -B) indirect recursion



The QuickSort algorithm is used to sort ________.

A) lists stored in arrays or linear linked lists

B) tree data structures

C) randomly-ordered files
$11.49
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
DRtests

Also available in package deal

Thumbnail
Package deal
PACKAGE DEAL FOR;COMPUTER SCIENCE FINAL EXAM QUESTIONS AND CORRECT ANSWERS 2025-2026 (FULLY COVERED)
-
7 2025
$ 77.93 More info

Get to know the seller

Seller avatar
DRtests stuvia
View profile
Follow You need to be logged in order to follow users or courses
Sold
1
Member since
7 months
Number of followers
0
Documents
73
Last sold
4 months ago
DottyTESTS 100%

READILY AVAILABLE STUDY MATERIALS.

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions