1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Yuliya22 [10]
3 years ago
12

What are the best data structures to create the following items? And why? Designing a Card Game with 52 cards. Online shopping c

art (Amazon, eBay, Walmart, Cosco, Safeway, ...) Online waiting list (De Anza College class waiting list, ...) Online Tickets (Flight tickets, concert tickets, ...)
Mathematics
1 answer:
NeX [460]3 years ago
3 0

Answer:

The best data structure in storing card is an array.

The best choice for a shopping cart is hash-maps. the advantage of harsh mark is that they are dynamic in nature.

Waiting lists are managed by a method called the  First In First Out. when an individual is  waiting  for too long, he or she should be given the first chance for service.

Sorted links are a better options for storing tickets.

Step-by-step explanation:

Solution

In other to store the cards the best structure to be applied here is an array.

Now, we are aware the array size, which comprises of 52 items, and hence card vales can be  easily stored  For standard 52-deck cards, a 2D array of size 4x15 can also be applied, with 4 being color count, and 13 being card in each color.

In this example, the better option for shopping cart is hash-maps, because it is dynamic in nature for instance, when items are  removed and more often, and also, there is a need for mapping of item ID or name to its actual database, so these values can be kept or stored as key-value pairs.

Waiting lists are normal managed in a way of First In First Out, since a person is waiting longer should be given the first chance for service. this FIFO method is best used by a Queue. so this online waiting list can best be used by a queue.

For tickets storing, a better option will be the sorted linked lists. because the tickets are to be stored in a large amount, and there will be deletions and insertions in large quantity. so keeping them in a sorted list will reduce the resource usage and the trade-off made as high search time will also have less effect, as there will be a limited number of searches.

 

You might be interested in
Priscilla can make 3 bracelets in 15 minutes. At this rate, how many bracelets can she make in 30 minutes?
BigorU [14]

Answer:

6 bracelets

Step-by-step explanation:

If she can make 3 in 15, just multiply by 2 to get 30 minutes. Therefore she can make 6 bracelets in 30 minutes.

7 0
3 years ago
Read 2 more answers
The frequency table shows the scores from rolling a dice. Work out the median<br><br><br>​
nikitadnepr [17]

Answer:

need a little more information

Step-by-step explanation:

6 0
3 years ago
95-a(b+c) when a= 9, b = 3 and c=7.4 I don’t get how to solve this please put an explanation
Marianna [84]

Notice that in the statement of the exercise are the values of a, b and c. Then, to evaluate the given expression, we replace the given values of a, b, and c. So, we have:

\begin{gathered} a=9 \\ b=3 \\ c=7.4 \\ 95-a\mleft(b+c\mright) \\ \text{ We replace the given values} \\ 95-a(b+c)=95-9(3+7.4) \\ 95-a(b+c)=95-9(10.4) \\ 95-a(b+c)=95-93.6 \\ 95-a(b+c)=\boldsymbol{1.4} \end{gathered}

Therefore, the result of evaluating the given expression when a = 9, b = 3, and c = 7.4 is 1.4.

7 0
1 year ago
The civil war had 6,020 people visit in 4 days. how many people visited each day
tatiyna
During the civil war, 1505 visited the war
5 0
3 years ago
Read 2 more answers
the following set of numbers is going to be graphed on a histogram if there are going to be six intervals what is the length of
Alex787 [66]
What is the lenght display?
8 0
4 years ago
Other questions:
  • Sharonda uses a blend of dark chocolate and milk chocolate to make the ice cream topping at her restaurant. She needs to buy 120
    11·1 answer
  • Please help with factoring these x²-11x+18
    6·2 answers
  • Find the distance between A = (2,0) and B = (0,9)
    6·1 answer
  • Which shapes can you use to model the log and the board
    15·1 answer
  • What is the value of the red dot on the number line below?
    12·2 answers
  • What are the solutions to x2 + 8x + 7 = 0? A. x = –8 and x = –7 B. x = –7 and x = –1 C. x = 1 and x = 7 D. x = 7 and x = 8
    15·2 answers
  • Write (2n^2)^3 without exponents
    7·1 answer
  • 100 points / please help! i have no idea what im doing...
    5·2 answers
  • WILL MARK THE BRAINLIEST
    8·1 answer
  • PLEASE someone help its due tonight im almost done
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!