Exam1-Justin-Exam
.pdf
keyboard_arrow_up
School
University of Maryland, College Park *
*We aren’t endorsed by this school
Course
351
Subject
Computer Science
Date
Feb 20, 2024
Type
Pages
8
Uploaded by SargentClover11186
CMSC351 Fall 2022 Exam 1 Justin’s Section
NAME (Neatly):
UID (Neatly):
Instructions:
Please do all problems on the pages and in the spaces provided. This
exam will be scanned into Gradescope and if your answers are not in the correct locations
they will not be found or graded!
.
THIS PAGE INTENTIONALLY LEFT BLANK! DO NOT USE!
1. Fill in the following as
True
or
False
.
Any answers that are unclear will be marked as
[10 pts]
incorrect.
Statement
True/False
Bubble Sort is best-case Θ(1).
If
f
(
n
)
̸
= Ω(
n
2
) then
f
(
n
) =
O
(
n
2
).
Selection Sort is stable.
Kadane’s Algorithm is Ω(
n
).
A Θ(
n
) algorithm is always faster than a Θ(
n
2
) algorithm.
2. Suppose Kadane’s algorithm is run on a list of length 7. The values of
maxendingati
are given
[5 pts]
in the table below. Fill in the values of
maxoverall
.
i
maxendingati
maxoverall
0
4
1
1
2
3
3
-1
4
8
5
13
6
12
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
• List the staff names whose last name ends with a “d”.• List the staff names whose last name does NOTbegins with a “B”.• List the staff names whose last name does NOT havea “e” in the 2 nd letter.• List the staff names whose last name begins with “B”and the 3 rd letter is a “e”.
arrow_forward
Transcribed Image Text
A summer camp offers a morning session and an afternoon session. The list morningList contains the names of all children attending the morning session, and the list afternoonList contains the names of all children attending the afternoon session. Only children who attend both sessions eat lunch at the camp. The camp director wants to create lunchList, which will contain the names of children attending both sessions. The following code segment is intended to create lunchList, which is initially empty. It uses the procedure IsFound (list, name), which returns true if name is found in list and returns false otherwise. FOR EACH child IN morningList { <MISSING CODE> Which of the following could replace <MISSING CODE> so that the code segment works as intended? IF (IsFound (afternoonList, child)) { A APPEND (lunchList, child)
arrow_forward
Week 4 IPO
Assignment Content
There are 4question Create IPO chart
q1. When Trina began her trip from New York to Florida, she filled her car's tank with
gas and
reset its trip meter to zero. After traveling 324 miles, Trina stopped at a gas station to refuel; the
gas tank required 17 gallons.
arrow_forward
Exercise 1 - Ms excel
Insert Pivot Table: Your task is to bring up the pivot table. Then remove the grand total and edit the pivot table.
Group Data by Year: The second task is to group the sales amount by the year or months.
Find Running Total by Date: Your objective is to find the running total by date using the data.
Insert a Pie Chart: You will create a pie chart from the data in this problem, you will need to insert slicer to the pivot table. Use the calculated Field to find the sales tax which is 5% of the total sales.
arrow_forward
Question 20 (1 point)
You have a flexbox with child boxes in a row. You want the child boxes to be displayed in the
opposite order in which they appear currently. Which code do you use?
1) flex-flow: column-reverse
2) flex-flow: row-reverse
3) flex-flow: row-order-reverse
4) flex-flow: reverse
arrow_forward
Article Link:
https://www.mdpi.com/2304-6740/11/2/65Write a summary about the article
- Summarize the main idea/point(s)
- Please include excerpts from the article to emphasize a point, but it must be cited as an in-text citation. E.g. "Quote." (Author's lat name page) For example, (John 6)
arrow_forward
Task 4:
You have been given a spreadsheet that contains details of invoices. The column headers for the
spreadsheet are:
date, invoice number, invoice amount, invoice tax, invoice total, cust number, cust name, cust street, cust
city, cust state, cust postal code, cust nation, product code, product price, product quantity, salesrep
number, salesrep first name, salesrep last name, salesrep district, district name, and district size.
Create a high fidelity data model. In other words, list the set of tables (=entities) with their respective
column headers. If easier, and alternatively, you can draw an ERD diagram. (Optional: Add some sample
data).
arrow_forward
The Problems - contains only problems from the last 2 contests
Separate Un-Attempted, Attempted and All cards Problem Difficulty Rating - The
Featured drop-down menu has different difficulty ranges so you can try problems that
best suit your experience.
Popular topics and brands Like most users, Chef didn't know that he could add
problems to his personal to-do list by clicking the magic "+" symbol in the upper
right corner of each problem page. But once he found out about it, he went crazy and
added a lot of problems to his to-do list without looking at their difficulty rating.
Rajesh is a beginner and ideally should only try to solve problems strictly below
10001000. Given the difficulty rating list of problems in Chef's to-do list, please help
him determine how many of these problems Chef should remove from his to-do list
so he is left with only problems with a difficulty rating of less than 10001000.
Note: Please answer the question in Python only:
Input
1
4
999 1000 1001 1002…
arrow_forward
WEEK 3 ASSIGNMENT
This assignment contains two parts. You must complete Part I before moving on to Part II.
Part I:
Using the table you previously worked on, complete the following exercise:
Insert a row into your student table where the last name is "Parker", first name is "Sam" and the ZIP code is "68134". You can determine the values for the remaining columns.
Select a row from your student table where the last name equals "Parker".
Select a row from your student table where the ZIP code is less than "68134".
Select the student first and last name from the student table order by the state column.
Part II:
Complete the following exercise:
Using your student table select all students that have a last name of “Parker” and have a first name that starts with “S”. Order your results by state.
Using your student table select all students with ZIP codes between “23164” and “98164”.
Using your student table select all students where states are in Florida and New York.
Using your…
arrow_forward
Task 4:
The InstantRide User Satisfaction team is a core team for InstantRide, and they focus on increasing the customer satisfaction. They want to learn the travel time for each ride in the system. You need to return the USER_ID, and the TRAVEL_TIME column which is calculated using the TIMEDIFF function on the TRAVEL_END_TIME and the TRAVEL_START_TIME.
arrow_forward
. Create a list of authors that displays the last name followed by the first name for each author.
The last names and first names should be separated by a comma and a blank space.
HINT: Use || for contenation
arrow_forward
Please create a constraint file using the images below. The code that is in one of the images is a Verilog code for the M1 chart. Use the M1 chart and the Verilog code to create a constraint file.
arrow_forward
v Question Completion Status:
Moving to another question will save this response.
Question 3
The values returned by range (12, 20, 2) returns
O 20, 18, 16, 14, 12
O 12, 14, 16, 18
O 12, 14, 16, 18, 20
O 20,18, 16, 14
A Moving to another question will save this response.
G 4)
arrow_forward
Extra 6-1 Develop the Temperature Converter
In this exercise, you’ll use radio buttons to determine whether the conversion is from Fahrenheit to Celsius or vice versa. You’ll also modify the DOM so the labels change when a radio button is clicked, and the page displays an error message when the user enters invalid data.
1. Open the application in this folder:
exercises_extrach06convert_temps
2. Note that the JavaScript file has some starting JavaScript code, including the $() function, three helper functions, three event handler functions, and a DOMContentLoaded event handler that attaches the three event handlers.
3. Review how the toCelsius() and toFarhenheit() event handler functions call the toggleDisplay() helper function and pass it strings to display. Also note that the toggleDisplay() helper function and the convertTemp() event handler function are incomplete.
4. Code the toggleDisplay() function so it changes the text in the labels for the text boxes to the values in the…
arrow_forward
Favorite Color
Rank the following colors according to your preference with 1 being the most preferred and 5 the least preferred color.
Survey Result: (50 respondents)
Favorite Color Ranking
1st
2nd
3rd
4th
5th
Blue
8
7
9
15
11
Red
16
9
7
9
9
Yellow
11
14
11
5
9
Violet
4
11
17
10
8
Green
11
9
6
11
13
Instructions: Create a preference schedule for the rankings cast by your respondents.
arrow_forward
Task 4:
The InstantRide User Satisfaction team is a core team for InstantRide, and they focus on increasing the customer satisfaction. They want to learn the travel time for each ride in the system. You need to return the USER_ID, and the TRAVEL_TIME column which is calculated using the TIMEDIFF function on the TRAVEL_END_TIME and the TRAVEL_START_TIME.
arrow_forward
Question 02: Following screen needs to be design in AWT/Swing.
When user click “Add New” button, Record should be entered and displayed in the TextArea shown at top.
When user click “Delete” Entered record should be cleared from the TextArea.
When user click “Close” button, it will exit the program.
arrow_forward
files for the work: https://mega.nz/file/AEJQFZIT#IKKIb5DD9h-5fHiWzEAIg8Lm60syggKnAwL1fqQQ168
Therefore, you should have print statements only where it is explicitly mentioned in the assignment. If you have additional print statements, make sure they are all converted to comments before you submit the assignment. Page 4 of 12 Assignment # 4 Due: Nov. 27th 11:00 PM 1. Text File Format Download the zipped file Files_for_A4 from Brightspace. When you will extract this zipped file you should find the following text files in the folder. The sample text files (datafile) are aTaleOfTwoCities.txt, harry.txt, harryPotter.txt, and invisibleMan.txt. You may assume that the words of the text files are separated by spaces (* ') and newline characters ( *\n'). You will be using these text files to do the analysis. There are two additional files (wordfile) named positivewords.txt and negativewords.txt; each of these files contains a sequence of words (one word per line) and these words will be…
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Related Questions
- • List the staff names whose last name ends with a “d”.• List the staff names whose last name does NOTbegins with a “B”.• List the staff names whose last name does NOT havea “e” in the 2 nd letter.• List the staff names whose last name begins with “B”and the 3 rd letter is a “e”.arrow_forwardTranscribed Image Text A summer camp offers a morning session and an afternoon session. The list morningList contains the names of all children attending the morning session, and the list afternoonList contains the names of all children attending the afternoon session. Only children who attend both sessions eat lunch at the camp. The camp director wants to create lunchList, which will contain the names of children attending both sessions. The following code segment is intended to create lunchList, which is initially empty. It uses the procedure IsFound (list, name), which returns true if name is found in list and returns false otherwise. FOR EACH child IN morningList { <MISSING CODE> Which of the following could replace <MISSING CODE> so that the code segment works as intended? IF (IsFound (afternoonList, child)) { A APPEND (lunchList, child)arrow_forwardWeek 4 IPO Assignment Content There are 4question Create IPO chart q1. When Trina began her trip from New York to Florida, she filled her car's tank with gas and reset its trip meter to zero. After traveling 324 miles, Trina stopped at a gas station to refuel; the gas tank required 17 gallons.arrow_forward
- Exercise 1 - Ms excel Insert Pivot Table: Your task is to bring up the pivot table. Then remove the grand total and edit the pivot table. Group Data by Year: The second task is to group the sales amount by the year or months. Find Running Total by Date: Your objective is to find the running total by date using the data. Insert a Pie Chart: You will create a pie chart from the data in this problem, you will need to insert slicer to the pivot table. Use the calculated Field to find the sales tax which is 5% of the total sales.arrow_forwardQuestion 20 (1 point) You have a flexbox with child boxes in a row. You want the child boxes to be displayed in the opposite order in which they appear currently. Which code do you use? 1) flex-flow: column-reverse 2) flex-flow: row-reverse 3) flex-flow: row-order-reverse 4) flex-flow: reversearrow_forwardArticle Link: https://www.mdpi.com/2304-6740/11/2/65Write a summary about the article - Summarize the main idea/point(s) - Please include excerpts from the article to emphasize a point, but it must be cited as an in-text citation. E.g. "Quote." (Author's lat name page) For example, (John 6)arrow_forward
- Task 4: You have been given a spreadsheet that contains details of invoices. The column headers for the spreadsheet are: date, invoice number, invoice amount, invoice tax, invoice total, cust number, cust name, cust street, cust city, cust state, cust postal code, cust nation, product code, product price, product quantity, salesrep number, salesrep first name, salesrep last name, salesrep district, district name, and district size. Create a high fidelity data model. In other words, list the set of tables (=entities) with their respective column headers. If easier, and alternatively, you can draw an ERD diagram. (Optional: Add some sample data).arrow_forwardThe Problems - contains only problems from the last 2 contests Separate Un-Attempted, Attempted and All cards Problem Difficulty Rating - The Featured drop-down menu has different difficulty ranges so you can try problems that best suit your experience. Popular topics and brands Like most users, Chef didn't know that he could add problems to his personal to-do list by clicking the magic "+" symbol in the upper right corner of each problem page. But once he found out about it, he went crazy and added a lot of problems to his to-do list without looking at their difficulty rating. Rajesh is a beginner and ideally should only try to solve problems strictly below 10001000. Given the difficulty rating list of problems in Chef's to-do list, please help him determine how many of these problems Chef should remove from his to-do list so he is left with only problems with a difficulty rating of less than 10001000. Note: Please answer the question in Python only: Input 1 4 999 1000 1001 1002…arrow_forwardWEEK 3 ASSIGNMENT This assignment contains two parts. You must complete Part I before moving on to Part II. Part I: Using the table you previously worked on, complete the following exercise: Insert a row into your student table where the last name is "Parker", first name is "Sam" and the ZIP code is "68134". You can determine the values for the remaining columns. Select a row from your student table where the last name equals "Parker". Select a row from your student table where the ZIP code is less than "68134". Select the student first and last name from the student table order by the state column. Part II: Complete the following exercise: Using your student table select all students that have a last name of “Parker” and have a first name that starts with “S”. Order your results by state. Using your student table select all students with ZIP codes between “23164” and “98164”. Using your student table select all students where states are in Florida and New York. Using your…arrow_forward
- Task 4: The InstantRide User Satisfaction team is a core team for InstantRide, and they focus on increasing the customer satisfaction. They want to learn the travel time for each ride in the system. You need to return the USER_ID, and the TRAVEL_TIME column which is calculated using the TIMEDIFF function on the TRAVEL_END_TIME and the TRAVEL_START_TIME.arrow_forward. Create a list of authors that displays the last name followed by the first name for each author. The last names and first names should be separated by a comma and a blank space. HINT: Use || for contenationarrow_forwardPlease create a constraint file using the images below. The code that is in one of the images is a Verilog code for the M1 chart. Use the M1 chart and the Verilog code to create a constraint file.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- COMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE LNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning