Implement a new version of the sparse life grid adt

Assignment Help Basic Computer Science
Reference no: EM131312881

1. Implement a new version of the Sparse Life Grid ADT from Chapter 4 to use a sorted list and the binary search to locate the occupied cells.

2. A colormap is a lookup table or color palette containing a limited set of colors. Early color graphics cards could only display up to 256 unique colors at one time. Colormaps were used to specify which 256 colors should be used to display color images on such a device. Software applications were responsible for mapping each color in the image that was to be displayed to a color in the limited color set specified by the colormap. We can define a Colormap ADT for storing a limited set of colors and for use in mapping one of the 16.7+ million colors possible in the discrete RGB color space to a color in the colormap. Given the description below of various operations, implement the Colormap ADT using a 1-D array structure.

* ColorMap( k ): Creates a new empty colormap that is capable of storing up to k colors.

* length (): Returns the number of colors currently stored in the colormap.

* contains ( color ): Determines if the given color is contained in the colormap.

* add( color ): Adds the given color to the colormap. Only one instance of each color can be added to the colormap. In addition, a color cannot be added to a full colormap.

* remove ( color ): Removes the given color from the colormap. The color must be contained in the colormap in order to be removed.

* map( color ): Maps the given color to an entry in the colormap and returns that color. A common approach is to map the color to its nearest neighbor in the colormap. The nearest neighbor of a color is the entry in the colormap that has the minimum Euclidean distance squared between the two colors. If there is more than one nearest neighbor in the colormap, only one is returned. In addition, the colormap must contain at least one color in order to perform the mapping operation.

* iterator (): Creates and returns an iterator object that can be used to iterate over the colors in the colormap.

Reference no: EM131312881

Questions Cloud

Describe the problem innovation targets : Describe the problem your innovation targets. What is the scope of the problem and which stakeholders, both within the organization and without, does it impact?
Write program that will store the lakers roster in an array : Write a program that will store the Lakers (or your favorite basketball team) roster in an array. You will then loop through the array to display each player and their information.
Specific key environmental forces : Explain what the specific key environmental forces are that created an opportunity for your company. Company, drive through Wine store.
Company requires a floating rate loan : Companies a and b have been offered the following rates per annum on a $100 million 5 year loan. Company A requires a floating rate loan; company b requires a fixed rate loan. design a swap that will appear equally attractive to both companies.
Implement a new version of the sparse life grid adt : Implement a new version of the Sparse Life Grid ADT from Chapter 4 to use a sorted list and the binary search to locate the occupied cells.
The labor movement in a global economy : The topics covered throughout the course will provide a starting point for further research. The final assignment must be supported by a solid foundation in labor relations concepts taken from the textbook as well as outside research. The research..
How does data analytics support your metrics : Develop a listing of what you believe are the most important metrics for operations managers. What data would be used to support this metric and how would you ensure that the data are of sufficient quality? How does data analytics support your metric..
Life insurance policy : Ramona and Pablo Valdez are a dual-career couple who just had their first child. Pablo, age 29, already has a group life insurance policy, but Ramona's employer does not offer life insurance. Help Ramona evaluate this advice and decide on an appropri..
Implement following functions related to singly linked list : The splitInHalf(head) function, which accepts a head reference to a singly linked list, splits the list in half and returns the head reference to the head node of the second half of the list. If the original list contains a single node, None shoul..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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