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)

Assignment-02.pdf

Rating
-
Sold
-
Pages
2
Grade
A
Uploaded on
27-07-2022
Written in
2021/2022

Exam of 2 pages for the course CSC 220 at CSC 220 (A)

Institution
Course

Content preview

CSC 220.01 ASSIGNMENT 02 SUMMER 2019 TA
ASSIGNMENT INSTRUCTIONS PERFORMANCE TRACKER
ASMT GRADE YOUR GRADE
1. Assignment 02: 50 points w/ 5 E.C. points
2. Due Date & Time: 07-13-2019 at 11:55 PM
00 15
01 50
WHAT TO SUBMIT 02 50
1. Assignment Report TOTAL 115
2. Code
A: 90-100% B: 80-89% C: 70-79% D: 60-69% F: 0-60%
The course grader provides feedback to your
HOW TO SUBMIT assignments on iLearn.
• Please refer to the “Guidelines for All Assignments” and the
“Assignment Report Template” which we discussed in detail in assignment 00.


Please download: http://csc220.ducta.net/Assignments/Assignment-02-Code.zip

PART A – The Bag, 20 points

Define the method removeAllOccurrences for the class LinkedBag that removes all occurrences of the given
entries from a bag. Your program’s output must be identical to this output:




PART B – The Efficiency of Algorithms, 10 points

1. Show how you count the number of operations (not only 2. Consider the following two loops, 4 points:
basic operations) required by the algorithm, 4 points:
// Loop A
sumList(aList, n) { for (i = 1; i <= n; i++)
thisSum = 0; for (j = 1; j <= 10000; j++)
sum = sum + j;
lastSum = 5000;
for (int i = 0; i <= n; i++) { // Loop B
thisSum = thisSum + aList[i] * 2; for (i = 1; i <= n; i++)
} for (j = 1; j <= n; j++)
sum = sum + j;
return thisSum >= lastSum;
} Although Loop A is O(n) and Loop B is O(n2), Loop B can be
faster than Loop A for small values of n. Design and
implement an experiment to find a value of n for which
Loop B is faster.
This study source was downloaded by 100000839306532 from CourseHero.com on 07-27-2022 15:59:36 GMT -05:00
Updated: 6/27/2019 10:36 AM
https://www.coursehero.com/file/43531082/Assignment-02pdf/

Written for

Course

Document information

Uploaded on
July 27, 2022
Number of pages
2
Written in
2021/2022
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$14.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
joylee

Get to know the seller

Seller avatar
joylee Charmbering school of nursing
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
4 year
Number of followers
0
Documents
99
Last sold
-

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

Working on your references?

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

Working on your references?

Frequently asked questions