Exam1C_Solutions
.pdf
keyboard_arrow_up
School
Pennsylvania State University *
*We aren’t endorsed by this school
Course
465
Subject
Computer Science
Date
Dec 6, 2023
Type
Pages
11
Uploaded by MinisterBadgerMaster464
Pennsylvania State University — CMPSC465 : Data Structures & Algorithms
Exam 1
Lecturers: Antonio Blanca and Yana Safonova
September 22, 2023
Exam 1 - C
Name:
Penn State access ID (xyz1234) in the following box:
Student ID number (9XXXXXXXX):
TA and/or section time:
Instructions:
•
Answer all questions. Read them carefully first. Be precise and concise. Handwriting needs to be neat.
Box numerical final answers.
•
Please clearly write your name and your PSU access ID (i.e., xyz1234) in the box on top of
every
page
.
•
Write in only the space provided. You may use the back of the pages only as scratch paper.
Do not
write your solutions in the back of pages!
•
Do not write outside of the black bounding box
: the scanner will not be able to read anything
outside of this box.
•
We are providing two extra page at the end if you need extra space. Make sure you mention in the
space provided that your answer continues there.
Good luck!
1
Name:
PSU Access ID (xyz1234):
Multiple choice questions
(27 points)
For each of the following questions, select the right answer by filling the corresponding grading bubble grading
bubbles.
1. Run Build-Heap on the array [3
,
5
,
4
,
8
,
6
,
2
,
10
,
1
,
8
,
11] to construct a min heap. Select the resulting min
heap.
1
2
6
11
8
5
8
3
10
4
(d)
1
3
5
8
8
6
11
2
4
10
(e)
1
3
5
4
10
6
11
2
8
8
(f)
2
3
5
8
10
8
6
4
1
11
(a)
3
5
8
8
6
11
2
4
10
1
(b)
1
2
6
8
10
5
11
3
4
8
(c)
Answer.
○
(a)
○
(b)
○
(c)
○
(d)
'!
(e)
○
(f)
2
Name:
PSU Access ID:
2. Consider the min heap below. Suppose the number 2 is inserted into the heap.
4
5
7
8
6
Which one of the following is the resulting min heap?
4
5
7
8
6
2
(a)
2
5
7
8
4
6
(b)
2
4
6
7
5
8
(c)
2
5
6
8
4
5
(d)
4
5
7
8
2
6
(e)
Answer.
○
(a)
'!
(b)
○
(c)
○
(d)
3
Name:
PSU Access ID:
3. Consider the min heap on the left below.
Suppose that first the element at position 3 of the array is
removed from the heap (remember that we use 0 indexed arrays), and after that the element at position
1 is removed from the heap.
3
6
7
10
12
8
14
12
5
9
13
10
7
Which one of the following is the resulting min heap?
3
8
10
12
12
14
5
9
13
10
7
(a)
3
13
10
10
12
8
14
12
5
9
7
(b)
3
8
10
10
12
12
14
13
5
9
7
(c)
3
8
10
13
12
10
14
12
5
9
7
(d)
Answer.
○
(a)
○
(b)
'!
(c)
○
(d)
○
(e)
4
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
Distinguish between overlapping and disjoint restrictions.
arrow_forward
What is meant by indexing error?
arrow_forward
SUPPLIER
PRODUCT
ProductCode
ProductnName
unitPrice
SupCode
supCode
(Number, 3)
SupName
(text, 20)
АВC LLC
(Number, 10)
[Char(10)]
(>0)
1111111
Calculator
10
111
111
2222222
Notebook
2.5
777
222
ХҮX LLC
3333333
Book-AI
20
222
3333
PQR LLC
4444444
Pen
-2.0
222
222
AXL LLC
5555555
Pencil
.500
111
Eraser
.500
222
arrow_forward
Q_5
arrow_forward
Database management system:
Q.No.4 Do as directed
This describes the business process to publish an academic paper. The author submits a paper to an editor in chief of a journal. The editor first checks whether the paper fit the theme of the journal. If not, the editor rejects the paper. Otherwise, the editor in chief assigns the paper to a number of reviewers. The reviewers review the paper, and write a review. The review is sent to the editor in chief. The editor in chief then assesses the quality of the paper with the help of reviewers’ comments. If the quality is good, the paper will be accepted, and the author notified. Furthermore, the paper is forwarded to the publisher for publication. If the quality is bad, the editor rejects the paper.
a. Apply query to only access to compile the final decision to editor in chief and only visualized by author not reviewers
Professor don't reject answer the question.
arrow_forward
Database management system:
Q.No.4 Do as directed
This describes the business process to publish an academic paper. The author submits a paper to an editor in chief of a journal. The editor first checks whether the paper fit the theme of the journal. If not, the editor rejects the paper. Otherwise, the editor in chief assigns the paper to a number of reviewers. The reviewers review the paper, and write a review. The review is sent to the editor in chief. The editor in chief then assesses the quality of the paper with the help of reviewers’ comments. If the quality is good, the paper will be accepted, and the author notified. Furthermore, the paper is forwarded to the publisher for publication. If the quality is bad, the editor rejects the paper.
Apply index on paper that published in IEEE journal
Apply query to only access to compile the final decision to editor in chief and only visualized by author not reviewers.
Answer all and according to the Question.
Professor Don't…
arrow_forward
Database management system:
Q.No.4 Do as directed
This describes the business process to publish an academic paper. The author submits a paper to an editor in chief of a journal. The editor first checks whether the paper fit the theme of the journal. If not, the editor rejects the paper. Otherwise, the editor in chief assigns the paper to a number of reviewers. The reviewers review the paper, and write a review. The review is sent to the editor in chief. The editor in chief then assesses the quality of the paper with the help of reviewers’ comments. If the quality is good, the paper will be accepted, and the author notified. Furthermore, the paper is forwarded to the publisher for publication. If the quality is bad, the editor rejects the paper.
Apply join between editor in chief and reviewers.
Apply join between editor in chief and author.
Apply index on paper that published in IEEE journal
Apply query to only access to compile the final decision to editor in chief and only…
arrow_forward
DATABASE SYSTEMS:
QUESTION
Do as directed
This describes the business process to publish an academic paper. The author submits a paper to an editor in chief of a journal. The editor first checks whether the paper fit the theme of the journal. If not, the editor rejects the paper. Otherwise, the editor in chief assigns the paper to a number of reviewers. The reviewers review the paper, and write a review. The review is sent to the editor in chief. The editor in chief then assesses the quality of the paper with the help of reviewers’ comments. If the quality is good, the paper will be accepted, and the author notified. Furthermore, the paper is forwarded to the publisher for publication. If the quality is bad, the editor rejects the paper.
Apply query to only access to compile the final decision to editor in chief and only visualized by author not reviewers
arrow_forward
5
arrow_forward
Annotated Bibliography
As a graduate student, one of the fundamental techniques to gather research for a paper is the use of an Annotated Bibliography. Furthermore, as a human-computer interaction researcher, finding relevant literature to support a study is also part of preparing an analytical research paper. For this assignment, you’ve been assigned a topic (see below). You’ve also been assigned to a specific group (see Groups in Blackboard). Each member of the group is to find five UNIQUE references. These references are to be scholarly papers, not wiki, blog, or Website entries. Do not include textbooks or trade publications either. The use of Google Scholar is STRONGLY recommended. IMPORTANT: To support your research journey, read the Levy & Ellis (2006) article on how to maximize your research opportunities in Information Systems Research.
(5 to 6) entries.
Your assigned topic is as follows:
Context-Aware Computing
arrow_forward
python program
arrow_forward
Deliverables:
List of actors
List of use-cases
UML Use-Case Diagram
Overview Statement:
For its chain of fast food outlets, Chicago Bino's Pizza has recently installed a new online system to speed up deliveries and improve customer satisfaction. When a customer places an online order to have pizza delivered, an employee verifies the order and checks the customers phone number against a data store containing past orders. If the order is for a repeat customer, the system matches the number with the customer database and displays the customer record on the screen. (Customer records contain a variety of information, including whether the customer's dog bites.) For first-time customers, the employee (salesman) verifies the caller's name and address, and creates a record in the customer database.
The order taker (salesman) verifies the customer's pizza order within 10 minutes after the customer placed the order online. After 10 minutes from placing the order by the customer and the…
arrow_forward
Computer Science
Create a code in PHP that connects to a online database. This database needs to be able to establish a connection and give an error if lost. as wells as, search, filter, and add new results to the database as well as the web page(HTML) by its users(genre, name, author, volume, and completed/ongoing). The code must also give a error message if certain parts are left blank when adding to the webpage.
The database is a basic mangalist
arrow_forward
Barcode Validation
As you are aware, barcodes encode numbers. In the Universal Product Code system, each item is
assigned a globally unique number.
But not every number is a valid UPC. Why? Part of the answer is the check digit.
In order to catch errors, the rightmost digit is calculated from the others. If this digit does not match
its expected value, you can be assured the barcode is invalid, or has been read incorrectly.
To calculate the check digit, perform the following operations modulo 10:
• Sum the digits in the odd positions and multiply the result by three.
• Add the digits in the even positions to the result.
• Subtract the result from 10 to obtain the check digit.
Your Task
Given a 12-digit UPC, you will need to identify whether is is valid or invalid.
The code will be provided from standard input. You simply need to print "valid" or "invalid" in
response.
Notes
The code will be provided on a line by itself, and will consist of numerals alone. You may assume
that it will be…
arrow_forward
Search coures
eneral » Final Exam, Computer Örganization 110408240, Sep 1 2021
After three logical left shifts to the value 1100100101, the answer will be
PAGE
arrow_forward
Computer Science: What is the reason that sometimes much more space is reserved for a numeric field than any initial values stored.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Enhanced Discovering Computers 2017 (Shelly Cashm...
Computer Science
ISBN:9781305657458
Author:Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:Cengage Learning
Related Questions
- Distinguish between overlapping and disjoint restrictions.arrow_forwardWhat is meant by indexing error?arrow_forwardSUPPLIER PRODUCT ProductCode ProductnName unitPrice SupCode supCode (Number, 3) SupName (text, 20) АВC LLC (Number, 10) [Char(10)] (>0) 1111111 Calculator 10 111 111 2222222 Notebook 2.5 777 222 ХҮX LLC 3333333 Book-AI 20 222 3333 PQR LLC 4444444 Pen -2.0 222 222 AXL LLC 5555555 Pencil .500 111 Eraser .500 222arrow_forward
- Q_5arrow_forwardDatabase management system: Q.No.4 Do as directed This describes the business process to publish an academic paper. The author submits a paper to an editor in chief of a journal. The editor first checks whether the paper fit the theme of the journal. If not, the editor rejects the paper. Otherwise, the editor in chief assigns the paper to a number of reviewers. The reviewers review the paper, and write a review. The review is sent to the editor in chief. The editor in chief then assesses the quality of the paper with the help of reviewers’ comments. If the quality is good, the paper will be accepted, and the author notified. Furthermore, the paper is forwarded to the publisher for publication. If the quality is bad, the editor rejects the paper. a. Apply query to only access to compile the final decision to editor in chief and only visualized by author not reviewers Professor don't reject answer the question.arrow_forwardDatabase management system: Q.No.4 Do as directed This describes the business process to publish an academic paper. The author submits a paper to an editor in chief of a journal. The editor first checks whether the paper fit the theme of the journal. If not, the editor rejects the paper. Otherwise, the editor in chief assigns the paper to a number of reviewers. The reviewers review the paper, and write a review. The review is sent to the editor in chief. The editor in chief then assesses the quality of the paper with the help of reviewers’ comments. If the quality is good, the paper will be accepted, and the author notified. Furthermore, the paper is forwarded to the publisher for publication. If the quality is bad, the editor rejects the paper. Apply index on paper that published in IEEE journal Apply query to only access to compile the final decision to editor in chief and only visualized by author not reviewers. Answer all and according to the Question. Professor Don't…arrow_forward
- Database management system: Q.No.4 Do as directed This describes the business process to publish an academic paper. The author submits a paper to an editor in chief of a journal. The editor first checks whether the paper fit the theme of the journal. If not, the editor rejects the paper. Otherwise, the editor in chief assigns the paper to a number of reviewers. The reviewers review the paper, and write a review. The review is sent to the editor in chief. The editor in chief then assesses the quality of the paper with the help of reviewers’ comments. If the quality is good, the paper will be accepted, and the author notified. Furthermore, the paper is forwarded to the publisher for publication. If the quality is bad, the editor rejects the paper. Apply join between editor in chief and reviewers. Apply join between editor in chief and author. Apply index on paper that published in IEEE journal Apply query to only access to compile the final decision to editor in chief and only…arrow_forwardDATABASE SYSTEMS: QUESTION Do as directed This describes the business process to publish an academic paper. The author submits a paper to an editor in chief of a journal. The editor first checks whether the paper fit the theme of the journal. If not, the editor rejects the paper. Otherwise, the editor in chief assigns the paper to a number of reviewers. The reviewers review the paper, and write a review. The review is sent to the editor in chief. The editor in chief then assesses the quality of the paper with the help of reviewers’ comments. If the quality is good, the paper will be accepted, and the author notified. Furthermore, the paper is forwarded to the publisher for publication. If the quality is bad, the editor rejects the paper. Apply query to only access to compile the final decision to editor in chief and only visualized by author not reviewersarrow_forward5arrow_forward
- Annotated Bibliography As a graduate student, one of the fundamental techniques to gather research for a paper is the use of an Annotated Bibliography. Furthermore, as a human-computer interaction researcher, finding relevant literature to support a study is also part of preparing an analytical research paper. For this assignment, you’ve been assigned a topic (see below). You’ve also been assigned to a specific group (see Groups in Blackboard). Each member of the group is to find five UNIQUE references. These references are to be scholarly papers, not wiki, blog, or Website entries. Do not include textbooks or trade publications either. The use of Google Scholar is STRONGLY recommended. IMPORTANT: To support your research journey, read the Levy & Ellis (2006) article on how to maximize your research opportunities in Information Systems Research. (5 to 6) entries. Your assigned topic is as follows: Context-Aware Computingarrow_forwardpython programarrow_forwardDeliverables: List of actors List of use-cases UML Use-Case Diagram Overview Statement: For its chain of fast food outlets, Chicago Bino's Pizza has recently installed a new online system to speed up deliveries and improve customer satisfaction. When a customer places an online order to have pizza delivered, an employee verifies the order and checks the customers phone number against a data store containing past orders. If the order is for a repeat customer, the system matches the number with the customer database and displays the customer record on the screen. (Customer records contain a variety of information, including whether the customer's dog bites.) For first-time customers, the employee (salesman) verifies the caller's name and address, and creates a record in the customer database. The order taker (salesman) verifies the customer's pizza order within 10 minutes after the customer placed the order online. After 10 minutes from placing the order by the customer and the…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Enhanced Discovering Computers 2017 (Shelly Cashm...Computer ScienceISBN:9781305657458Author:Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. CampbellPublisher:Cengage Learning
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Enhanced Discovering Computers 2017 (Shelly Cashm...
Computer Science
ISBN:9781305657458
Author:Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:Cengage Learning