Computer Science: An Overview (12th Edition)
12th Edition
ISBN: 9780133760064
Author: Glenn Brookshear, Dennis Brylow
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 9, Problem 58CRP
Program Plan Intro
Sequential files:
- A sequential file is a file that has same order of organization of records in which they are entered.
- The order of records does not change in sequential file.
- The information is arranged in a row in sequential files.
- In a sequential file, we can write and read data in a sequence only.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
We can generalize two-pass multiway merge-sort to use more than two passes. On the first pass, we divide the file into as many groups as we can merge in one pass. Then, recursively sort each group, using as many passes as necessary, and finally merge the sorted groups.A file of 1000 blocks is to be externally sorted, using 40 main-memory buffers. How many passes are needed? How many runs remain at the last pass? Find the correct number in the list below.
a) The number of passes required is 2.b) The number of passes required is 3.c) The number of runs at the last pass is 10.d) The number of passes required is 1.
1. Given that F is a direct file with n = 2000 records and that the records are stored in orderof their keys. Determine how any record reads it would take to locate a particular record using:a. Sequential search (average case)b. Binary search (worst case)c. (open) hashing with 200 buckets (average case)d. (open) hashing with 400 buckets (average case)
2. Write the declarations to create a data type called: DICTIONARY that represents an openhashing scheme with 20 buckets
Question 3
You have a row of 2n disks of two colors, n dark and n light. They alternate: dark, light, dark, light, and so on. You want to get all the dark disks to the right-hand end, and the light disks to the left-hand end. The only moves you are allowed to make are those that interchange the positions of two neighboring disks. Design a brute force algorithm for solving this puzzle and determine the number of moves it takes.
Chapter 9 Solutions
Computer Science: An Overview (12th Edition)
Ch. 9.1 - Identify two departments in a manufacturing plant...Ch. 9.1 - Prob. 2QECh. 9.1 - Summarize the roles of the application software...Ch. 9.2 - Prob. 1QECh. 9.2 - Prob. 2QECh. 9.2 - Prob. 4QECh. 9.2 - Prob. 5QECh. 9.2 - Prob. 6QECh. 9.3 - Prob. 1QECh. 9.3 - What is a persistent object?
Ch. 9.3 - Identify some classes as well as some of their...Ch. 9.3 - Prob. 4QECh. 9.4 - Prob. 1QECh. 9.4 - Prob. 2QECh. 9.4 - Prob. 3QECh. 9.4 - Prob. 4QECh. 9.4 - Prob. 5QECh. 9.4 - Prob. 6QECh. 9.5 - Prob. 1QECh. 9.5 - Prob. 2QECh. 9.5 - Prob. 3QECh. 9.5 - Prob. 4QECh. 9.5 - Prob. 5QECh. 9.5 - Prob. 6QECh. 9.5 - Prob. 7QECh. 9.6 - Prob. 1QECh. 9.6 - Give an additional example of a pattern that might...Ch. 9.6 - Prob. 3QECh. 9.6 - How does data mining differ from traditional...Ch. 9.7 - Prob. 1QECh. 9.7 - Prob. 2QECh. 9.7 - Prob. 3QECh. 9.7 - Prob. 4QECh. 9 - Prob. 1CRPCh. 9 - Prob. 2CRPCh. 9 - Prob. 3CRPCh. 9 - Prob. 4CRPCh. 9 - Prob. 5CRPCh. 9 - Prob. 6CRPCh. 9 - Prob. 7CRPCh. 9 - Prob. 8CRPCh. 9 - Prob. 9CRPCh. 9 - Prob. 10CRPCh. 9 - Prob. 11CRPCh. 9 - Prob. 12CRPCh. 9 - Using the commands SELECT, PROJECT, and JOIN,...Ch. 9 - Answer Problem 13 using SQL. PROBLEM 13 13. Using...Ch. 9 - Prob. 15CRPCh. 9 - Prob. 16CRPCh. 9 - Prob. 17CRPCh. 9 - Prob. 18CRPCh. 9 - Prob. 19CRPCh. 9 - Empl Id Name Address SSN Job Id Job Title Skill...Ch. 9 - Empl Id Name Address SSN Job Id Job Title Skill...Ch. 9 - Prob. 22CRPCh. 9 - Prob. 23CRPCh. 9 - Prob. 24CRPCh. 9 - Prob. 25CRPCh. 9 - Write a sequence of instructions (using the...Ch. 9 - Prob. 27CRPCh. 9 - Prob. 28CRPCh. 9 - Prob. 29CRPCh. 9 - Prob. 30CRPCh. 9 - Prob. 31CRPCh. 9 - Prob. 32CRPCh. 9 - Prob. 33CRPCh. 9 - Prob. 34CRPCh. 9 - Prob. 35CRPCh. 9 - Prob. 36CRPCh. 9 - Prob. 37CRPCh. 9 - Prob. 38CRPCh. 9 - Prob. 39CRPCh. 9 - Prob. 40CRPCh. 9 - Prob. 41CRPCh. 9 - Prob. 42CRPCh. 9 - Prob. 43CRPCh. 9 - Prob. 44CRPCh. 9 - Prob. 45CRPCh. 9 - Prob. 46CRPCh. 9 - Prob. 47CRPCh. 9 - Prob. 48CRPCh. 9 - Prob. 49CRPCh. 9 - Prob. 50CRPCh. 9 - Prob. 51CRPCh. 9 - Prob. 52CRPCh. 9 - Prob. 53CRPCh. 9 - Prob. 54CRPCh. 9 - Prob. 55CRPCh. 9 - Prob. 56CRPCh. 9 - Prob. 57CRPCh. 9 - Prob. 58CRPCh. 9 - Prob. 59CRPCh. 9 - Prob. 60CRPCh. 9 - Prob. 61CRPCh. 9 - Prob. 62CRPCh. 9 - Prob. 1SICh. 9 - Prob. 2SICh. 9 - Prob. 3SICh. 9 - Prob. 4SICh. 9 - Prob. 5SICh. 9 - Prob. 6SICh. 9 - Prob. 7SICh. 9 - Prob. 8SICh. 9 - Prob. 9SICh. 9 - Prob. 10SI
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
- Assume you have a folders of (images and videos) in your computer which contain some random mix numerical values. Your task is to separate images (e.g odd values) and videos (e.g Even values). So that all the images and videos are stored in separate folders (lists). While separating make sure that any of the folder (lists) should not contain any duplicate file or duplicate value. In this task images and videos odd & even numbers and folder means a single list of mix value. e.g: linkedlists (odd, even). Design a method for above task which will create two separate linked lists and write main method to test your program. FOLDER (VIDEO AND IMAGES:ODD AND EVEN VALUES) LIST 0: [2, 44 , 24 , 82 , 33 , 44 , 55 , 11 , 2 , 44 , 55]: EVEN VALUES_LIST 1: [2, 44 , 24 , 82]: A=2, B=44, C=24, D=82 ODD VALUES:_LIST 2: [33 , 44 , 55 , 11]: A=33, B=45, C=55, D=11arrow_forwardRefer to the previous question. How many passes will it take to sort the file completely?arrow_forwardYour aim is to determine the largest k numbers among n numbers stored in a text file with one number per line.(n >> k). However, we can only read n numbers from the file line by line, ie one by one, we do not have the possibility to read and store them all at once. Under these circumstances, implement the algorithm, which finds and returns k numbers with the largest value for a given value of k out of n numbers in the file, in a programming language of your choice. Your algorithm's timecomplexity should be better than O (nk).arrow_forward
- Use python to cluster the points that given in the file points.txt. Use K-means algorithm. You should use different number of clusters 2,3,4, and 5. Draw the results of each case and show the points of each cluster with different color. Explain which one is the best and discuss the results. file content of point.txt x y0.12 0.290.57 0.190.60 0.570.06 0.280.06 0.420.15 0.250.02 0.200.44 0.240.83 0.760.62 0.330.52 0.640.86 0.150.10 0.350.91 0.580.11 0.470.52 0.290.14 0.110.56 0.240.00 0.170.57 0.380.85 0.300.92 0.510.99 0.380.51 0.080.22 0.130.10 0.300.51 0.160.59 0.470.76 0.340.08 0.500.62 0.440.52 0.190.17 0.140.94 0.350.59 0.470.44 0.320.94 0.520.66 0.360.45 0.440.84 0.070.53 0.230.55 0.130.60 0.590.37 0.620.24 0.190.58 0.160.87 0.520.41 0.040.11 0.450.44 0.140.40 0.040.40 0.620.83 0.060.40 0.290.39 0.560.37…arrow_forwardSolve using matlabarrow_forwardYou are given a collection of N non-empty strings, denoted by S₁, S₂,..., Sn. Then you are given N-1 operations which you execute in the order they are given. The įth operation is has the following format: 'a b' (1-based indexing, without the quotes), which means that you have to make the following changes: 1. Sa = Sa+ Sb, i.e. concatenate ath string and 6th string and store the result in ath string, 2. S = "", i.e. make the 6th string empty, after doing the previous step. You are ensured that after the ith operation, there will be no future operation that will be accessing S. Given these operations to join strings, print the last string that will remain at the end of this process. Input The first line contains an integer N (1 ≤N≤ 105) denoting the number of strings given. Each of the next N lines contains a string denoting the S₁. All the characters in the string S, are lowercase alphabets from 'a' to 'z'. The total number of characters over all the strings is at most 106, i.e Σ₁|S₁|…arrow_forward
- Modify your code so that before the game begins, the player is asked whether they wish to enter their guesses manually, or to automatically guess based on pre-supplied guesses in a file. If the first option is chosen, then the game should progress in the same fashion as in the tasks above. If the second option is chosen, then the following actions should be taken: Firstly, the player should be asked to enter a filename. If the player enters an invalid filename, they should be re-prompted until they enter the name of a file that actually exists. This file should then be read and interpreted as a text file, where each line contains a separate guess. For example, a sample file input.txt may contain the following text: 1234 4321 5830 8437 1489 3271 2530 You may assume that each line of the file contains a valid guess. Once the file has been read, then the game should proceed as normal. However, when the player would be prompted to enter a guess, the next guess in the list of pre-supplied…arrow_forwardPart I Assume that a N x M matrix is stored in a file. However, the file is corrupted somehow, and some numbers replaced with asterisk symbol (*). Write a method that reads given corrupted file and fills the missing data with the average of the column. For example, given matrix 1 3 4 6 7 8. 10 11 12, missing data should be replaced with 2+8+11 = 7. Part II Assume that multiple messages are encrypted with Ceaser ciphering' and stored in a file. Write a method that deciphers the messages with given shift value. Note: Use English alphabet with only lower-case characters. Part III Assume that multiple arithmetic operations? are stored in a file. However, some of the results are wrong. Write a method that finds the operations which the results are wrong in given file. For example, given operations 1.0 + 2.0 4.0 2.5 + 2.5 5.0 3.0 / 2.0 1.0 %D the method should return 0th and 2nd line strings. Note: Do not round the numbers in any step of the calculation.arrow_forwardYou have a huge text file with words in it. Find the smallest distance (in terms of number of words) between any two words in the file. Can you optimise your solution if the procedure will be performed several times for the same file (but different pairs of words)?arrow_forward
- Consider the adjacency matrix below. Upload a picture (it can be hand drawn) of the adjacency list of the graph. Note: File size must not exceed 1 MB. * C DE 1 1 1 1 1. A, 1. 1. A, CI D.arrow_forwardPlease Pleas Please Please help and create a simple python program that does the following.arrow_forwardCorrect answer will be upvoted else downvoted. Computer science. You have an arrangement a with n components 1,2,3,… ,k−1,k,k−1,k−2,… ,k−(n−k) (k≤n<2k). How about we call as reversal in a couple of files i<j to such an extent that a[i]>a[j]. Assume, you have some change p of size k and you assemble an arrangement b of size n in the accompanying way: b[i]=p[a[i]]. You will probably find such change p that the absolute number of reversals in b doesn't surpass the all out number of reversals in a, and b is lexicographically greatest. Little update: the grouping of k integers is known as a stage in the event that it contains all integers from 1 to k precisely once. Another little update: a grouping s is lexicographically more modest than another succession t, if either s is a prefix of t, or for the primary I to such an extent that si≠ti, si<ti holds (in the principal position that these arrangements are unique, s has more modest number than t). Input…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
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