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
Both array lists and linked lists are examples of how a list may be implemented. Discuss a scenario when a linked list might be preferable than a list stored in an array. Explain your reasoning in each situation.
I 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.
What are the requirements for determining if a linked list T is empty if T is one of the following: (i) a simple singly linked list, (ii) a headed singly linked list, (iii) a simple circularly linked list, or (iv) a headed circularly linked list?
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
- In this question, you are to implement two functions for reversing linked lists. One function, reverse_iter(..), must use an iterative approach (i.e., loops), whereas the other function, reverse_rec(..), must use recursion instead. We have already implemented the linked list as well as all its helper-functions in the Ilist-module.arrow_forwardWrite an algorithm to implement the frequency count self-organizing list heuristic, assuming that the list is implemented using an array. In particular, write a function FreqCount that takes as input a value to be searched for and which adjusts the list appropriately. If the value is not already in the list, add it to the end of the list with a frequency count of one. Write an algorithm to implement the move-to-front self-organizing list heuristic, assuming that the list is implemented using an array. In particular, write a function MoveToFront that takes as input a value to be searched for and which adjusts the list appropriately. If the value is not already in the list, add it to the beginning of the list. Write an algorithm to implement the transpose self-organizing list heuristic, assuming that the list is implemented using an array. In particular, write a function Transpose that takes as input a value to be searched for and which adjusts the list appropriately. If the…arrow_forwardDo 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.arrow_forward
- Implement a function to insert a node at the end of a doubly linked list. Explain the steps involved and analyze the time complexity of your implementation.arrow_forwardHow does a link-based implementation of the List differ from an array-based implementation? Select one: a. All of these b. A link-based implementation does not need to shift entries over to make room when adding a new entry to the List c. A link-based implementation is sized dynamically so it takes up only the memory to hold the current entries d. A link-based implementation does not need to shift entries up to remove a gap when removing an entry from the Listarrow_forwardCreate an implementation of singly linked list using classes with minimum 5 nodes (spectre, togusa, yuri, siren, shepherd) in Python with the following capabilities/functions: Traverse - print out all data from the linked list Insert - generate a node and attach to an existing linked list Search - find an item (data) from the linked list and return the node Remove - remove a node from the linked listarrow_forward
- Java Design and draw a method called check() to check if characters in a linked list is a palindrome or not e.g "mom" or "radar" or "racecar. spaces are ignored, we can call the spaces the “separator”. The method should receive the separator as a variable which should be equal to “null” when no separator is used.arrow_forwardLooking at all four list implementations, which actions/methods tend to be less efficient in the Linked List implementation compared to the Array Implementation? Explain why for each action/method you specify.arrow_forwardImplements 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 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): def clone(self): def clone_node(node): return <... YOUR CODE HERE ...> r = <... YOUR CODE HERE...> return r return L4_class(*args,**kwargs)arrow_forward
- Please fast...... avoid plagiarism Explain in your own words the steps necessary to add a value to the tail of a single-ended, singly-linked list. The list should have a reference (pointer) to its head and should terminate in nullptr/NULL/none. Make sure you deal with all possible cases.arrow_forwardTurn the linked list implementation into a circular list: Have the previous pointer of the first node point to the last node, and the next pointer of the last node point to the first node. Then remove the last pointer in the List class because the value can now be obtained as first->previous. Reimplement the member functions so that they have the same effect as before. please use linked list. programming language c++arrow_forwardThis is assignment used C++. Develop a linked-list processing function, IsolateTargetSoloAsTail, to process a linked list as follows. ● If a target cannot be found on the given list, a new node containing the target is created and added to the list's end (made the new tail node). ► This includes the case where the given list is empty, in which the new tail node added is also the new head node. (This is so because the only node in a 1-node list is the list's head and tail node.) ● If the target appears only once on the given list, the target-matching node is moved to the list's end (made the new tail node). ► Nothing needs to be done if the target-matching node is already the tail node (of the given list). ● If the target appears multiple times on the given list, the first target-matching node is moved to the list's end (made the new tail node), and all other target-matching nodes are to be deleted from the list. ► Note that although…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning