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)

Ch. 4 Computer Science 201 Data Structures & Algorithms Exam Questions with Answers.

Rating
-
Sold
-
Pages
3
Grade
A+
Uploaded on
12-04-2025
Written in
2024/2025

Ch. 4 Computer Science 201: Data Structures & Algorithms Exam Questions with Answers The ingredients in an algorithm are called: - Correct Answers: Inputs Instead of a list of steps, algorithms can be written using: - Correct Answers: Flowcharts with arrows to illustrate the journey A programming algorithm is like: - Correct Answers: A recipe An algorithm always leads to a(n): - Correct Answers: Solution An algorithm is written down as: - Correct Answers: A list of steps What is one major drawback of experimental analysis? - Correct Answers: Implementation of programs What are asymptotic notations? - Correct Answers: Notations that allow us to analyze an algorithm's running time by identifying its behavior as the input size for the algorithm increases. What is NOT an asymptotic notation? - Correct Answers: β If f(n) is the function then O(f(n)) = { g(n) : there exists c 0 and n0 such that f(n) ≤ c.g(n) for all n n0. } is true for which of the following symptotic notations ? - Correct Answers: Big Oh An experimental analysis depends on the _____ results, so an algorithm cannot be measured unless an _____ is implemented. - Correct Answers: output; equivalent program Kara's code includes a binary search operation. Which of the following functions would be optimal to test the execution time of this function? - Correct Answers: Log n An algorithm tests the air pressure on a slope at different altitudes. Given that the pressure depends on the altitude, what is the optimal algorithmic function to use? - Correct Answers: Linear In a linear function, the time taken is _____ if the size of the input is doubled. - Correct Answers: doubled Out of a random bunch of last years' holiday greeting cards, Clara wants to find the one her mother sent her. The optimal algorithm to use will be _____. - Correct Answers: N-log-N Brian has an algorithm to read through an array that contains numbers 1 through 26 and convert each number to an English alphabet. He runs the algorithm a number of times with no changes to the size of the array and no changes to the task done. The function to use is: _____ - Correct Answers: f(n) = c What is the time complexity of the following ? i=0;while(in){ j=i;while(jn && ji+5){ /* code */j++;}i=j; } - Correct Answers: O(N) If one for loop runs with size N and the other with size M and the loops follow a linear function, what is the expected time complexity? - Correct Answers: O(M+N) What is space complexity? - Correct Answers: Amount of storage an algorithm needs to work If an algorithm runs in quadratic time, what is its time complexity using Big-O ? - Correct Answers: O(N2) For a linear function, what would be its time complexity? - Correct Answers: O(N) Which method is used to prove a mathematical statement true, by assuming the negation of it to also be true? - Correct Answers: contrapositive In algorithm analysis, space complexity describes _____. - Correct Answers: the total memory space consumed In loop variants, the relationship between the variables _____. - Correct Answers: is the same before and after the loops Why is it necessary to analyze an algorithm? - Correct Answers: All of the above Contrapositive and contradiction fall under which category of algorithm analysis? - Correct Answers: Contra Attack

Show more Read less
Institution
Data Structures And Algorithm Analysis In C+
Module
Data Structures and Algorithm Analysis in C+

Content preview

Ch. 4 Computer Science 201:
Data Structures & Algorithms
Exam Questions with Answers
The ingredients in an algorithm are called: - Correct Answers: Inputs



Instead of a list of steps, algorithms can be written using: - Correct Answers: Flowcharts with arrows to
illustrate the journey



A programming algorithm is like: - Correct Answers: A recipe



An algorithm always leads to a(n): - Correct Answers: Solution



An algorithm is written down as: - Correct Answers: A list of steps



What is one major drawback of experimental analysis? - Correct Answers: Implementation of programs



What are asymptotic notations? - Correct Answers: Notations that allow us to analyze an algorithm's
running time by identifying its behavior as the input size for the algorithm increases.



What is NOT an asymptotic notation? - Correct Answers: β



If f(n) is the function then O(f(n)) = { g(n) : there exists c > 0 and n0 such that f(n) ≤ c.g(n) for all n > n0. }
is true for which of the following symptotic notations ? - Correct Answers: Big Oh



An experimental analysis depends on the _____ results, so an algorithm cannot be measured unless an
_____ is implemented. - Correct Answers: output; equivalent program



Kara's code includes a binary search operation. Which of the following functions would be optimal to
test the execution time of this function? - Correct Answers: Log n

Written for

Institution
Data Structures and Algorithm Analysis in C+
Module
Data Structures and Algorithm Analysis in C+

Document information

Uploaded on
April 12, 2025
Number of pages
3
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

£14.17
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
SAVEMYEXAMS

Also available in package deal

Get to know the seller

Seller avatar
SAVEMYEXAMS stuvia
Follow You need to be logged in order to follow users or courses
Sold
2
Member since
1 year
Number of followers
2
Documents
1594
Last sold
10 months ago
SAVEMYEXAMS

Assignments, Case Studies, Research, Essay writing service, Questions and Answers, Discussions etc. for students who want to see results twice as fast. I have done papers of various topics and complexities. I am punctual and always submit work on-deadline. I write engaging and informative content on all subjects. Send me your research papers, case studies, psychology papers, etc, and I’ll do them to the best of my abilities. Writing is my passion when it comes to academic work. I’ve got a good sense of structure and enjoy finding interesting ways to deliver information in any given paper. I love impressing clients with my work, and I am very punctual about deadlines. Send me your assignment and I’ll take it to the next level. I strive for my content to be of the highest quality. Your wishes come first— send me your requirements and I’ll make a piece of work with fresh ideas, consistent structure, and following the academic formatting rules. For every student you refer to me with an order that is completed and paid transparently, I will do one assignment for you, free of charge!!!!!!!!!!!!

Read more Read less
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 exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight 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 smashed 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