Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 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

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

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
$11.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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
$ 33.16 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
1 year
Number of followers
0
Documents
73
Last sold
11 months ago
DottyTESTS 100%

READILY AVAILABLE STUDY MATERIALS.

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions