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)

Data structures Exam Prep Part 1- Recursion, Algorithm Analysis & Stack Answered Correctly!!!

Rating
-
Sold
-
Pages
6
Grade
A+
Uploaded on
30-07-2025
Written in
2024/2025

Data structures Exam Prep Part 1- Recursion, Algorithm Analysis & Stack Answered Correctly!!!

Institution
Data Structures
Course
Data Structures

Content preview

Data structures Exam Prep Part 1-
Recursion, Algorithm Analysis & Stack
Answered Correctly!!!
Data structures can be said to be an ADT's ______.
1 specifications
2 implementation
3 abstraction
4 definition CORRECT ANSWERS 2 implementation

The specifications of an ADT's operations indicate ______.
1 what the operations do
2 how to store the data in the ADT
3 how to carry out the operations
4 how to implement the operations CORRECT ANSWERS 2 what the operations do

Which of the following is not an primitive data type in C++?
1 string
2 char
3 bool
4 double CORRECT ANSWERS 1 string

In a recursive solution to a problem, we solve a problem P(n) by solving another
problem P(k) where
1 P(k) is smaller than P(n)
2 P(k) is same as P(n)
3 P(k) is the hardest part of P(n)
4 P(k) is a larger problem than P(n) CORRECT ANSWERS 1 P(k) is smaller than P(n)

A(n) ______ is a C++ construct that enables a programmer to define a new data type.
1 data field
2 object
3 method
4 class CORRECT ANSWERS 4 class

The function
int fact (int k)
{
return k * fact(k-1);
if (k == 0) return 1;
}
1 computes the factorial on an integer k passed to it as parameter
2 works for all non-negative values of k, but not for negative numbers.

, 3 returns the value 1 if it is passed a value of 0 for the parameter k
4 does not correctly handle its base case CORRECT ANSWERS 4 does not correctly
handle its base case

When a function contains a function call to itself, such function is _____.
1 self-reference
2 reciprocal
3 repetitive
4 recursive CORRECT ANSWERS 4 recursive

The factorial of n is equal to
1 factorial (n-1)
2 n - factorial (n-1)
3 n * factorial (n-1)
4 n - 1 CORRECT ANSWERS 3 n * factorial (n-1)

When a programmer writes a definition to make a new type to be used for a declaration,
the new type is called a:
1 programmer-defined type
2 struct-defined type
3 client-defined type
4 primitive data type CORRECT ANSWERS 1 programmer-defined type

How many times is the following code invoked by the call recursive(4)?

void recursive( int i )
{
if (i < 8)
{
cout << i << " ";
recursive(i);
}
}

14
2 This is an infinite recursion
38
4 2 CORRECT ANSWERS 2 This is an infinite recursion

When an algorithm has an upper limit to the number of instructions, regardless of the
size of n, it is referred to as a(n) ______________ algorithm.
1 limited
2 time complex
3 constant time
4 instruction-truncated CORRECT ANSWERS 3 constant time

Written for

Institution
Data Structures
Course
Data Structures

Document information

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

Subjects

$13.49
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
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
ElevatedExcellence Exam
Follow You need to be logged in order to follow users or courses
Sold
924
Member since
3 year
Number of followers
504
Documents
18336
Last sold
7 hours ago
GETSOCIO EDUCATION

We have launched our assignments at a very reasonable price so that every student can enjoy its features. Our new method is gathering quite a positive feedback from the students, and many of our alumnus are fully satisfied with it. We would be glad if you purchase from us. THANK YOU!!

3.8

175 reviews

5
79
4
36
3
29
2
10
1
21

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

Working on your references?

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

Working on your references?

Frequently asked questions