EBK DATA STRUCTURES AND ALGORITHMS IN C
EBK DATA STRUCTURES AND ALGORITHMS IN C
4th Edition
ISBN: 9781285415017
Author: DROZDEK
Publisher: YUZU
bartleby

Concept explainers

Question
Book Icon
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...

Blurred answer
Students have asked these similar questions
Whentheuserenters!!,themostrecentcommandinthehistoryisexecuted.In the example above, if the user entered the command: Osh> !! The ‘ls -l’ command should be executed and echoed on user’s screen. The command should also be placed in the history buffer as the next command. Whentheuserentersasingle!followedbyanintegerN,theNthcommandin the history is executed. In the example above, if the user entered the command: Osh> ! 3 The ‘ps’ command should be executed and echoed on the user’s screen. The command should also be placed in the history buffer as the next command. Error handling: The program should also manage basic error handling. For example, if there are no commands in the history, entering !! should result in a message “No commands in history.” Also, if there is no command corresponding to the number entered with the single !, the program should output "No such command in history."
Activity No. Activity Time (weeks) Immediate Predecessors 1 Requirements collection 3 2 Requirements structuring 4 1 3 Process analysis 3 2 4 Data analysis 3 2 5 Logical design 50 3,4 6 Physical design 5 5 7 Implementation 6 6 c. Using the information from part b, prepare a network diagram. Identify the critical path.
2. UNIX Shell and History Feature [20 points] This question consists of designing a C program to serve as a shell interface that accepts user commands and then executes each command in a separate process. A shell interface gives the user a prompt, after which the next command is entered. The example below illustrates the prompt osh> and the user's next command: cat prog.c. The UNIX/Linux cat command displays the contents of the file prog.c on the terminal using the UNIX/Linux cat command and your program needs to do the same. osh> cat prog.c The above can be achieved by running your shell interface as a parent process. Every time a command is entered, you create a child process by using fork(), which then executes the user's command using one of the system calls in the exec() family (as described in Chapter 3). A C program that provides the general operations of a command-line shell can be seen below. #include #include #define MAX LINE 80 /* The maximum length command */ { int…
Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Text book image
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr