subject

Two different implementations of the list adt: arraylist and lllist. for each of the following applications, decide which list implementation would be better for that particular application. you should consider both time efficiency and space efficiency, and you should assume that both implementations have an associated iterator like the lllistiterator that we discussed in lecture. explain your answers.

you need to store information about the gardening tools that you sell in your online store. to do so, you maintain a list of product records, each of which contains information about a single type of product, including how many copies of it you have in stock. you don’t tend to change the types of tools that you sell, and thus items are seldom added or removed from the list. however, you need to update a product’s record whenever your inventory of that product changes (e. g., because someone purchases a product’s position in the list is also its product id, and therefore updating a record involves using the product id to get the corresponding record and modifying its contents.

you need to maintain a list of tweets that are made by government officials in the current week. the number of tweets can vary widely from week to week in a way that is hard to predict. you start with an empty list at the start of the week, and as tweets are made you add them to the list. you need to frequently display the tweets in reverse chronological order – from most recent to least recent.

you are responsible for maintaining a monthly list of events for an online arts calendar. the number of events is fairly consistent from month to month. events are added to the list in chronological order, and you need to display them in that same order.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:30
Some of your friends have gotten into the burgeoning field of time-series data mining, in which one looks for patterns in sequences of events that occur over time. purchases at stock exchanges--what’s being bought-- are one source of data with a natural ordering in time. given a long sequence s of such events, your friends want an efficient way to detect certain "patterns" in them--for example, they may want to know if the four events buy yahoo, buy ebay, buy yahoo, buy oracle occur in this sequence s, in order but not necessarily consecutively. they begin with a collection of possible events (e.g., the possible’ transactions) and a sequence s of n of these events. a given event may occur multiple times in s (e.g., yahoo stock may be bought many times in a single sequence s). we will say that a sequence s’ is a subsequence of s if there is a way to delete certain of the events from s so that the remaining events, in order, are equal to the sequence s’. so, for example, the sequence of four events above is a subsequence of the sequence buy amazon, buy yahoo, buy ebay, buy yahoo, buy yahoo, buy oracle their goal is to be able to dream up short sequences and quickly detect whether they are subsequences of s. so this is the problem they pose to you: give an algorithm that takes two sequences of even~s--s’ of length m and s of length n, each possibly containing an event more than once--and decides in time o(m n) whether s’ is a subsequence of s
Answers: 2
question
Computers and Technology, 22.06.2019 03:40
Mary's manager told her she should insert a graphic into her documentwrite mary a brief note describing how to insert a graphicin a word processing document.
Answers: 1
question
Computers and Technology, 22.06.2019 17:00
Which of the following is not contained on the slide show toolbar? a. next button b. slide button c. close button d. pen too
Answers: 2
question
Computers and Technology, 23.06.2019 11:00
How should you specify box sizes on a web page if you want the boxes to vary according to the font size of the text they contain? a. in pixels b. in inches c. as percentages d. in em units
Answers: 2
You know the right answer?
Two different implementations of the list adt: arraylist and lllist. for each of the following appl...
Questions
question
English, 23.10.2020 14:00
Questions on the website: 13722363