Implementation of self-adjusting lists

Assignment Help Basic Computer Science
Reference no: EM13968070

1. Write an algorithm for printing a singly linked list in reverse, using only constant extra space. This instruction implies that you cannot use recursion but you may assume that your algorithm is a list member function. Can such an algorithm be written if the routine is a constant member function?

2. a. Write an array implementation of self-adjusting lists. In a self-adjusting list, all insertions are performed at the front. A self-adjusting list adds a find operation, and when an element is accessed by a find, it is moved to the front of the list without changing the relative order of the other items.

b. Write a linked list implementation of self-adjusting lists.

c. Suppose each element has a ?xed probability, pi, of being accessed. Show that the elements with highest access probability are expected to be close to the front.

Reference no: EM13968070

Questions Cloud

Problem regarding the circular linked list : One way to implement a queue is to use a circular linked list. In a circular linked list, the last node's next pointer points at the ?rst node. Assume the list does not contain a header and that we can maintain, at most, one iterator corresponding..
How much work is required to stretch : The idea is that you exercise your muscles by stretching the spring from its natural length, which is 34 cm. If a 140 Newton force is required to keep the spring stretched to a length of 51 cm, how much work is required to stretch it from 52 cm to..
Underlying array structure : Ef?ciently implement a queue class using a circular array. You may use a vector (rather than a primitive array) as the underlying array structure.
Provide details on policy processes that were not utilized : Provide details on the other policy processes that were not utilized in your research. How could they be applied? Why would they be applicable?
Implementation of self-adjusting lists : Write a linked list implementation of self-adjusting lists. Suppose each element has a ?xed probability, pi, of being accessed. Show that the elements with highest access probability are expected to be close to the front.
Program to evaluate a post?x expression : 1. Write a program to evaluate a post?x expression. 2. a. Write a program to convert an in?x expression that includes (, ), +, -, *, and / to post?x.
Application of operator : Looking ahead in an STL iterator requires an application of operator++, which in turn advances the iterator. In some cases looking at the next item in the list, without advancing to it, may be preferable.
Describe the various shipping boxes : Describe the various shipping boxes available to the customer as listed above and then create a second table that lists the US Postal Service Hat Rate boxes and their shipping costs
Find out the running time of program : What is the running time of your program? If M = 1, what is the running time of your program? How is the actual speed affected by the delete routine for large values  of N (N > 100,000)?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What is the difference between the result of statements

What is the difference between the result of the following two statements. int cents = (int)(100 * price + 0.5)

  Influence of culture on risks in offshore outsourcing

Read the journal article, titled, "Influence of Culture on Risks in Offshore Outsourcing of Software Projects: A Quantitative Study on Mum Effect".

  Non functional requirements

Analyse the Case Study documents and determine the non-functional requirements (NFRs) or system quality attributes necessary to meet the needs identified in the Case Study. Document your analysis with a System Wide Requirement document. Make sure ..

  Compare b-mac, z-mac and s-mac for wireless sensor networks

Compare B-MAC, Z-MAC and S-MAC for wireless sensor networks.

  What are the functions of the cps

what are the functions of the CPS? (control prossesing system)

  Remove a table from the database in SQL

A large computer information system maintains many different computer files. Which amongst them is called a perpetual file?  Which command is used to remove a table from the database in SQL?

  Define a class named circle

Define a pure abstract base class called BasicShape. The BasicShape class should have the following members.

  Find parity of binary number stored in accumulator

Use an algorithm similar to one in Question 1 to find the parity (odd/even) of a binary number stored in the accumulator.

  Write a program that uses an arraylist of parameter type

For example, if "elmore" is the search target then any contact where the first name, last name, phone number, or email address contains "elmore" should be returned for display or deletion. Use a "for each" loop to iterate through the ArrayList.

  Hash function h is used and the signature

Suppose a hash function h is used and the signature must be valid for h(m) instead of m. Explain how  this scheme protects against existential forgery

  Operational analysis and quality improvement

Operational Analysis and Quality Improvement- Consider Kotter's eight-stage model of change (Table 2-1). How does it compare to Berwick's rules of the diffusion of innovation

  Suggest the maximum number of slides

Suggest the maximum number of slides

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd