EBK DATA STRUCTURES AND ALGORITHMS IN C
4th Edition
ISBN: 9781285415017
Author: DROZDEK
Publisher: YUZU
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 3, Problem 22E
Program Plan Intro
Self-organizing list:
- A self-organizing list, a kind of list which reorders its records depending on few heuristic self-organizing approaches to increase the average access time.
- The main goal of this is to increase the efficiency of the linear search by moving the most often accessed records to the head of the list.
- A self-organizing list attains a best case of constant time (nearly) for accessing records.
Techniques for rearranging nodes in the List:
- While ordering the records in the self-organizing list, normally the access probabilities of the records aren’t well known before.
- This issue led the researchers to develop several heuristics to estimate optimal behaviour.
- Some basic approaches used for reordering the records in the self-organizing list are given below.
- Move–to–front method (MFT)
- Transpose method.
- Count method.
- Ordering method.
Move–to–front method (MFT):
- After the required record is sited, keep that at the head of the list.
Transpose method:
- After the required record is sited, interchange that with its precursor.
Count method:
- Ordering the self-organizing list by number of times the records are being processed.
Ordering method:
- Ordering the self-organizing list by using definite criteria for information under analysis.
Explanation of Solution
(b) Efficiency of the methods when the list is implemented as a singly linked list:
- When the list is implemented as a singly linked list, a record node could be separated from the middle of the list; therefore, either two pointers are required when traversing the list, one pointer is used for the present node and the other pointer is used for the preceding node...
Explanation of Solution
(c) Efficiency of the methods when the list is implemented as a doubly linked list:
- When the list is implemented as a doubly l...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Write the code to delete a node in the middle of a list implemented as a linked list with the dummy node (see Exercise 3). Compare your answer with the answer to Exercise 3. Are they the same? What do you conclude? Does the dummy node simplify the operation on the list? How?
Do you know what the difference is between a single-linked list and a doubly-linked list?
When is it better to use a singly-linked list rather than a doubly-linked list?When is it better to use a doubly-linked list rather than a singly-linked list?
In a search for a node that is part of a linked list with N elements, how many nodes will be visited and how long will it take?
Describe the best- and worst-case scenarios that may occur during a search operation.Explain why the RemoveAfter() function is present in a singly-linked list yet the Remove() function is present in a doubly-linked list.Could the RemoveAfter() function be extended to include a doubly-linked list as well as a simple list? Explain why you believe this is the case, or why you believe it is not the case.What are the chances of implementing a Remove() function for a singly-linked list? Explain why you believe this is the case, or why you believe it is not the case.
write a code in modules and also with main class to implement the operation on linked list.. (searching , traversing , updating , and inserting.)
insertion will be In empty list, In front of list, In the middle of list, at the end of list.
The code should be in java language and also with simple coding and explanation.
Chapter 3 Solutions
EBK DATA STRUCTURES AND ALGORITHMS IN C
Ch. 3 - Prob. 1ECh. 3 - Prob. 2ECh. 3 - Prob. 3ECh. 3 - Prob. 4ECh. 3 - Prob. 5ECh. 3 - Prob. 6ECh. 3 - Prob. 7ECh. 3 - Prob. 8ECh. 3 - Prob. 9ECh. 3 - Prob. 10E
Ch. 3 - Prob. 11ECh. 3 - Prob. 12ECh. 3 - Prob. 13ECh. 3 - Prob. 14ECh. 3 - Prob. 15ECh. 3 - Prob. 16ECh. 3 - Prob. 17ECh. 3 - Prob. 18ECh. 3 - Prob. 19ECh. 3 - Prob. 20ECh. 3 - Prob. 21ECh. 3 - Prob. 22ECh. 3 - Prob. 23ECh. 3 - Prob. 24ECh. 3 - Prob. 25ECh. 3 - Prob. 1PACh. 3 - Prob. 2PACh. 3 - Prob. 3PACh. 3 - Prob. 5PACh. 3 - Prob. 7PA
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
- Implements clone which duplicates a list. Pay attention, because if there are sublists, they must be duplicated as well. Understand the implementation of the following function, which recursively displays the ids of each node in a list def show_ids(M, level=0): k = M.first_node while k is not None: print(" "*2*level, id(k)) if (str(k.value.__class__.__name__) == str(M.__class__.__name__)): show_ids(k.value, level+1) k = k.next W=L2(Node(10, Node(L2(Node(14, Node(15, Node(L2(Node(16, Node(17))))))), Node(20, Node(30)))) )show_ids(W) Develop your solution as follows: - First copy the nodes of the current list (self) - Create a new list with the copied nodes - Loop through the nodes of the new list checking the value field - If this field is also a list (use isinstance as in the show_ids function) then it calls clone on that list and substitutes the value. Complete the code: def L4(*args,**kwargs): class L4_class(L):…arrow_forwardImplement a self-organizing list by building a single linked list of nodes and frequently and randomly retrieving data from the list. Show what happens to the list when the count, move to front, and transpose techniques are applied to the same set of frequently retrieved items.arrow_forwardIs it possible to implement a sorted linked list using a DLL? What is the advantage of using a DLL versus a single linked list? Back up your point with a real example or application.arrow_forward
- In a 2- to 3-page paper, you will build on the material given in the course to answer the following questions: What is the difference between a single and doubly linked list? When might a singly-linked list be preferable than a doubly-linked list? When might a doubly-linked list be preferable than a singly-linked list? How many nodes will be visited during a search for a node that is in a linked list with N nodes? Describe the best- and worst-case scenarios for a search. Explain why a singly-linked list has the RemoveAfter() function while a doubly-linked list has the Remove() function. Is it possible to create a RemoveAfter() method for a doubly-linked list as well? Explain why you think that is or why you don't think that is. Is it possible to create a Remove() method for a singly-linked list as well? Explain why you think that is or why you don't think that is. Format your work according to the APA standards for the course you're in.arrow_forwardImplementing a Double-Ended List:Includes the firstLastList.cpp programme, which shows how to implement a double-ended list. (By the way, don't mix up the double-ended list with the double linked list, which we'll look at later in Hour 10, "Specialised Lists.")arrow_forwardYou are implementing two queues for the same data set, one by using array and one by using linked list. Compare the operations of insertion and deletion of the elements for time and space complexity separately.arrow_forward
- Question 1 write a curried SML function, filter, that takes two arguments, a predicate ( a function that takes a single argument and returns a bool) and a list. Calling filter f L returns a list containing only those elements of L that satisfy f (that is, only those elements that f returns true for are in the resulting list). Calling filter with an empty list returns an empty list. List members should appear in the same order in the results as in L. Do not use explicit recursion Full explain this question and text typing work only thanksarrow_forwardImplementing a Double-Ended List:contains the firstLastList.cpp program, which demonstrates a doubleended list. (Incidentally, don’t confuse the double-ended list with the doubly linked list, which we’ll explore later in Hour 10, “Specialized Lists.”)arrow_forwardImplement the three self-organizing list heuristics: Count – Whenever a record is accessed it may move toward the front of the list if its number of accesses becomes greater than the record(s) in front of it. Move-to-front – Whenever a record is accessed it is moved to the front of the list. This heuristic only works well with linked-lists; because, in arrays the cost of shifting all the records down one spot every time you move a record to the front is too expensive. Transpose – whenever the record is accessed swap it with the record immediately in front of it. Compare the cost of each heuristic by keeping track of the number of compares required when searching the list. Additional Instructions Use the SelfOrderedListADT abstract data type and the linked-list files I have provided to implement your self-ordered lists. You may incorporate the author’s linked list implementation via inheritance or composition, which ever makes the most sense to you (I will not evaluate that aspect of…arrow_forward
- By using JAVA, write a recursive display function, that print a linked list in reverse order.arrow_forwardI need a reference page for this question that was answered below. What is the difference between a singly-linked list and a doubly-linked list? In what situation would you use a singly-linked list over a doubly-linked list? In what situation would you use a doubly-linked list over a singly-linked list? If a node is in a linked list with N nodes, how many nodes will be traversed during a search for the node? Explain the best- and worst-case search scenarios. Explain why a singly-linked list defines a RemoveAfter() function, while a doubly-linked list defines a Remove() function. Could a RemoveAfter() function also be defined for a doubly-linked list? Explain why or why not. Could a Remove() function also be defined for a singly-linked list? Explain why or why not.arrow_forwardWrite a method for the Linked Based List class which returns the largest item in the list. If the list is empty return null. Assume that class T is Comparable.DO NOT USE ANY OTHER METHODS OF THE LINKED BASED LIST CLASS. What is the worst case and best case complexity of the code in the previous problem? Explain your answer.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