timer Asked: May 4th, 2020

Question Description

Lab 8 Rubric

Lab 8 Rubric


This criterion is linked to a learning outcomeComplexity of matchBruteForce() method

3.0 Pts

Correct result, answer explained at least briefly.

2.0 Pts

Correct result but no explanation of answer.

1.0 Pts

You tried to answer this at least.

0.0 Pts

Not submitted

3.0 pts

This criterion is linked to a learning outcomematch() method

14.0 Pts

Coded, works, O(n) complexity

10.0 Pts

Coded, works but not O(n)

7.0 Pts

Coded but has logic or runtime errors.

5.0 Pts

Coded but has syntax errors or won't run.

0.0 Pts

Not submitted

14.0 pts

This criterion is linked to a learning outcomeJava code in general

3.0 Pts

Clean, easy to read, descriptive variable names, appropriate sue of constants and comments.

2.0 Pts

Code is hard to follow, cryptic variable names, lack of comments, etc.

0.0 Pts

Not submitted

3.0 pts

Total points: 20.0

Unformatted Attachment Preview

Cuyamaca College CS-282 Intermediate Java Programming John Gerstenberg, Instructor Lab #8 Student Learning Outcomes  Algorithm analysis and implementation. Overview In real world software development, you will often “inherit” a software project from either a colleague or another programming team. Overall, the software may work but there are inefficient algorithms or other issues that require correction. In this exercise, you will be given a working program but you’ll need to implement a more efficient algorithm for one of its methods. Exercise 1: This exercise is based on exercise 22-3 on page 871. You are given a brute force version of a pattern matching algorithm called matchBruteForce(). Your task is to implement the match() method that will be O(n) time complexity. Do NOT use the String class indexOf() method. You may do this as a console application or you may use JavaFX. You are given starter code for this exercise. For a few quick points, what is the complexity of matchBruteForce(). To keep this quick and simple, put your answer and explanation in a comment in the code. Grading Criteria: Deliverable Time complexity of matchBruteForce() Match() method Java code 1 Points 3 Breakdown Correct result, answer explained at least briefly. 14 3 Coded, works, O(n) complexity Clean, easy to read, descriptive variable names, appropriate sue of constants and comments. // pseudocode for a match() method that is O(n) match(theString, pattern) i = 0 k = 0 pLen = length of pattern sLen = length of theString while i < sLen if k == pLen then return i - pLen else if (theString.charAt(i) == pattern.charAt(k)) then k = k + 1 // character matched else k = 0 // no match - reset and start over end end i = i + 1 end while if k == pLen then return sLen - pLen else return -1; ...
Student has agreed that all tutoring, explanations, and answers provided by the tutor will be used to help in the learning process and in accordance with Studypool's honor code & terms of service.

This question has not been answered.

Create a free account to get help with this and any other question!

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors