
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%
Please provide an

Transcribed Image Text:Problem 1: Suppose you have n two-digit numbers. For example, if n = 5, you
may have the following 5 two-digits number: 24 11 57 17 46
Your goal is to arrange your list in ascending order. So, for the example above,
CPS188 > Lab 02 > Computation and Introduction to C
your final answer would be: 11 17 24 46 57
Think of a procedure to perform this task (your list can have repeated numbers).
Test your idea with different values of n. Once you have decided how it can be
done, write your solution as a sequence of steps that can be followed in order.
How have you ensured that your algorithm eventually stops? Have you tested
your algorithm on unusual data (like numbers that are all the same, or that are
already sorted)? Number each step of your algorithm and explain briefly what its
role is in achieving your goal. Pick a list of numbers of your choice and show by
hand how your algorithm will achieve the sorting required.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write an Algorithm in Pseudocode for the Exercises Below Prompt user for 5 numbers and display the Total?arrow_forwardHelp pleasearrow_forwardPlease help me with this question. I am not understanding what to do. Please complete part 2 for the question. I am extremely confused (You do not need to do the contents of ex 5 Just need the part 2 for the question)arrow_forward
- In the algorithmic world, the steps are very similar, but we can use simple loops to dowhat we are doing manually.This would translate to a set of steps as below:Step 1: Open a new spreadsheetStep 2: Create the header row in every worksheetStep 3: For each workbook from a storeFor each worksheet in the workbookRead rows 2 to last row that contains dataMove this row to the current rowAdvance to next rowNext worksheetNext workbookStep 4: Save workbook Write code for given algrithm.arrow_forwardFor each problem, please provide i. Describe the worst-case input (the input that would cause the largest running time) Summation used to calculate number of steps for the worst case Explanation of how the code relates to the summation ii. iii. a. (loops require discussing number of iterations and steps per iteration) b. (recursion requires a diagram) A O bound iv.arrow_forwardWhat's the best way to describe an algorithm?arrow_forward
- d) Prepare a brief report (250 words) comparing the two algorithmsarrow_forward2. R(N) is the running time of strange_sum when called on a List of length N. Since this is recursive code, your answer to iii should include a diagram of the recursion tree. a. Answer for li being an ArrayList b. Answer for li being a LinkedList static int strange_sum(List li) { return strange_sum_helper(li, 0, li.size() - 1); static int strange_sum_helper (List arr, int left, int right) { if (right - left < 0) return 0; else if (right else { int mid = (left + right) / 2; return strange_sum_helper(arr, left, mid) left 0) return arr.get(left); == + strange_sum_helper(arr, mid + 1, right); } }arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education