Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Assignment 4 Note: When you turn in an assignment to be graded in this class you are making the claim that you neither gave

image text in transcribed

Programming Assignment 4 Note: When you turn in an assignment to be graded in this class you are making the claim that you neither gave nor received assistance on the work you turned in (except, of course, assistance from the instructor) In many search applications, real access patterns follow a rule of thumb called the 80/20 rule. The 80/20 rule states that 80% of the record accesses are to 20% of the records, while the values of 80 and 20 are only estimates, behavior of this nature occurs quite often in practice (which explains the success of caching techniques widely used by web browsers for speeding access to web pages, and by disk drive and CPU manufacturers for speeding access to data stored in slower memory). When the 80/20 rule applies, we can expect considerable improvements to search performance from a list ordered by frequency of access over standard sequential search in an unordered list In most applications, we don't know in advance the frequencies of access for the data records. To complicate matters further, certain records might be accessed frequently for a brief period of time, and then rarely thereafter. Thus, the probability of access for records might change over time. Self-organizing lists seek to solve both of these problems Self-organizing lists modify the order of records within the list based on the actual pattern of record access Self-organizing lists use a heuristic for deciding how to to reorder the list. Below are three traditional heuristics for managing self-organizing lists The most obvious way to keep a List ordered by frequency would be to store a count of accesses to each record and always maintain records in this order. This method will be referred to as count Whenever an entry in the List is accessed, it might move toward the front of the list if its number of accesses becomes greater than a record preceding it. Thus, count will store the records in the order of frequency that has actually occurred so far Another strategy is to bring an element to the front of the List when it is found, and moving all the other records back one position. This strategy is called move-to-front 1. 2. 3. Alternatively, elements could be self-organized via a process that swaps any record found with the record immediately preceding it in the list. This heuristic is called transpose Select one of the three strategies described above and implement it for a doubly-linked list with references to the first and last node that implements the ListInterface could interfere with the ordering of the self organizing list, so these methods should throw an exception Write a client class with the name Project4.java for your self-organizing list that reads in the name of a file from the command line as the first argument. The second command line argument contains a list of elements that are searched(accessed) from the original list. The program should display the contents of the list after it accesses all of the e sec ed to write a r metho It is expected that your program will be well documented and you are req printHeading i WI me e project number nd the Tm e firs ma s must contain a comment blo at the beginning that i of the information that wa mporta All r method printHeading; and a bri mment block implemented (you may develop your own algorithm, but it must be described in detail). Include r SelfOrganizingList class must include a paragraph describing which heuristic you WHY egy sign t reducti r project grade rd. Do ng Programming Assignment 4 Note: When you turn in an assignment to be graded in this class you are making the claim that you neither gave nor received assistance on the work you turned in (except, of course, assistance from the instructor) In many search applications, real access patterns follow a rule of thumb called the 80/20 rule. The 80/20 rule states that 80% of the record accesses are to 20% of the records, while the values of 80 and 20 are only estimates, behavior of this nature occurs quite often in practice (which explains the success of caching techniques widely used by web browsers for speeding access to web pages, and by disk drive and CPU manufacturers for speeding access to data stored in slower memory). When the 80/20 rule applies, we can expect considerable improvements to search performance from a list ordered by frequency of access over standard sequential search in an unordered list In most applications, we don't know in advance the frequencies of access for the data records. To complicate matters further, certain records might be accessed frequently for a brief period of time, and then rarely thereafter. Thus, the probability of access for records might change over time. Self-organizing lists seek to solve both of these problems Self-organizing lists modify the order of records within the list based on the actual pattern of record access Self-organizing lists use a heuristic for deciding how to to reorder the list. Below are three traditional heuristics for managing self-organizing lists The most obvious way to keep a List ordered by frequency would be to store a count of accesses to each record and always maintain records in this order. This method will be referred to as count Whenever an entry in the List is accessed, it might move toward the front of the list if its number of accesses becomes greater than a record preceding it. Thus, count will store the records in the order of frequency that has actually occurred so far Another strategy is to bring an element to the front of the List when it is found, and moving all the other records back one position. This strategy is called move-to-front 1. 2. 3. Alternatively, elements could be self-organized via a process that swaps any record found with the record immediately preceding it in the list. This heuristic is called transpose Select one of the three strategies described above and implement it for a doubly-linked list with references to the first and last node that implements the ListInterface could interfere with the ordering of the self organizing list, so these methods should throw an exception Write a client class with the name Project4.java for your self-organizing list that reads in the name of a file from the command line as the first argument. The second command line argument contains a list of elements that are searched(accessed) from the original list. The program should display the contents of the list after it accesses all of the e sec ed to write a r metho It is expected that your program will be well documented and you are req printHeading i WI me e project number nd the Tm e firs ma s must contain a comment blo at the beginning that i of the information that wa mporta All r method printHeading; and a bri mment block implemented (you may develop your own algorithm, but it must be described in detail). Include r SelfOrganizingList class must include a paragraph describing which heuristic you WHY egy sign t reducti r project grade rd. Do ng

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions