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

IT211 Fundemantals of Programming Midterm Exam Review 2025 (Qns & Ans)

Rating
-
Sold
-
Pages
27
Uploaded on
06-05-2025
Written in
2024/2025

IT211 Fundemantals of Programming Midterm Exam Review 2025 (Qns & Ans)IT211 Fundemantals of Programming Midterm Exam Review 2025 (Qns & Ans)IT211 Fundemantals of Programming Midterm Exam Review 2025 (Qns & Ans)











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

Document information

Uploaded on
May 6, 2025
Number of pages
27
Written in
2024/2025
Type
Exam (elaborations)
Contains
Unknown

Subjects

Content preview

IT211

Fundamentals of Programming

3.0 Credits

Midterm Exam Review (Qns & Ans)

2025




©2025

, Multiple Choice Questions (10 Questions)

1. Question:
Which of the following statements about tail recursion is true?
a. Tail recursion always leads to increased time complexity.
b. Tail recursion enables tail-call optimization, thereby reducing
the call stack usage.
c. Tail recursion requires storing additional state between
recursive calls.
d. Tail recursion results in non-terminating loops.

ANS:
b. Tail recursion enables tail-call optimization, thereby reducing
the call stack usage.

Rationale:
When a recursive call is the last operation in a function, the
compiler or interpreter can optimize it by reusing the current
function’s stack frame. This reduces memory overhead and
prevents stack overflow for deep recursive calls.

2. Question:
Big-O notation is used to describe the efficiency of an algorithm.
Which algorithm typically has a worst-case time complexity of O(n
log n)?
a. Linear search
b. Merge sort
c. Binary search
d. Bubble sort

ANS:
b. Merge sort

Rationale:
Merge sort divides the input into halves, recursively sorts them,
and then merges the sorted halves. Its divide-and-conquer
approach yields a worst-case running time of O(n log n).
©2025

, 3. Question:
Which technique is most effective for optimizing recursive
functions by avoiding redundant computations?
a. Loop unrolling
b. Divide and conquer
c. Memoization
d. Branch prediction

ANS:
c. Memoization

Rationale:
Memoization caches the results of function calls so that repeated
invocations with the same parameters can return the cached result,
significantly decreasing redundant computations in recursive
algorithms.

4. Question:
In C programming, dynamic memory allocation is performed
using which of the following pair of functions?
a. malloc() and free()
b. new and delete
c. alloc() and dealloc()
d. calloc() and realloc() exclusively

ANS:
a. malloc() and free()

Rationale:
In C, the standard functions malloc() for allocating memory and
free() for deallocating it are used for dynamic memory
management. (Note that new and delete are used in C++.)

5. Question:
In parameter passing, which description best fits "pass by
reference"?
a. Passing a copy of the variable’s value.
©2025

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.
emiliophd Walden University
View profile
Follow You need to be logged in order to follow users or courses
Sold
177
Member since
2 year
Number of followers
46
Documents
4725
Last sold
4 days ago

Hi there! I\'m a former nursing student who loves to share my knowledge and experience with others. I have a collection of past study notes and papers for nursing and other programs that I sell at affordable prices. Whether you need help with anatomy, pharmacology, ethics, or anything else, I have something for you. My notes are clear, concise, and fun to read. They will make your learning easier and more enjoyable. Plus, you\'ll get to see some of my witty comments and jokes along the way. Trust me, you won\'t regret buying from me!

Read more Read less
3.5

19 reviews

5
6
4
5
3
4
2
0
1
4

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