Question

Data Structures and Algorithms You have been asked to develop a tracking system for a take-out...

Data Structures and Algorithms

You have been asked to develop a tracking system for a take-out Chinese restaurant. The owner would like to be able to enter orders into the system as they come in, mark them as completed when they are picked up, and maintain historical data for repeat customers.

What data structures should be considered? Lets brainstorm….

0 0
Add a comment Improve this question Transcribed image text
Answer #1

I would suggest Hashing data structure for this problem.

Hashing involves using an index/key that represents each individual item. Here, each order can be uniquely identified using a number, which is ORDERID. In such case, ORDERID will be the hash key.

Reasons for choosing hashing:

(i) Adding new orders:

While adding new order, the orderid can be sequentially generated automatically. For hashing, the insertion process has a time complexity of O(1), which is very efficient.

(ii) Marking the orders completed:

Using hash key lookup enables quicker retrieval of data. Hence, once the orders are picked up, the owner can mark the orders as completed by only providing the order id. Given an ORDERID, it only takes O(1) for average case to retrieve the info. Hence, it is the most efficient in searching.

(iii) Maintaining historical data:

As the number of historical records increase beyond a certain limit, re-hashing can be done. Re-hashing involves increasing the size of the hash table and moving all the historical data for repeat customers according to the new hash table. So, keeping the historical data for repeat customers in a separate place in the hash table will help in quicker and efficient access of historical data for repeat customers, which is O(1) (average case).

Add a comment
Know the answer?
Add Answer to:
Data Structures and Algorithms You have been asked to develop a tracking system for a take-out...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • You have been asked to develop a database system to track the movies your customers viewed...

    You have been asked to develop a database system to track the movies your customers viewed over the past summer. The database system must structured in such a way as to be able to produce a variety of reports related to the movies viewed: Movies Released During Summer Movie Genre Rating X-Men: Days of Future Past Action/Adventure PG-13 Maleficent Family and Kids PG Edge of Tomorrow Science Fiction PG-13 How to Train your Dragon 2 Family and Kids PG Transformers:...

  • You are the designer and you have been asked to design a speed reducer (gearbox) that will take p...

    power = 3 kW if need any more information please ask !!! You are the designer and you have been asked to design a speed reducer (gearbox) that will take power from the shaft of an electric motor rotating at 1500 rpm and deliver it to a machine that is to operate at approximately at 200 rpm Assume that you have decided to use spur gears to transmit the power [A power equal to the last one digits of your...

  • For your Project, you will develop a simple battleship game. Battleship is a guessing game for...

    For your Project, you will develop a simple battleship game. Battleship is a guessing game for two players. It is played on four grids. Two grids (one for each player) are used to mark each players' fleets of ships (including battleships). The locations of the fleet (these first two grids) are concealed from the other player so that they do not know the locations of the opponent’s ships. Players alternate turns by ‘firing torpedoes’ at the other player's ships. The...

  • Can Technology Save Sears? Sears, Roebuck used to be the largest retailer in the United States, w...

    Can Technology Save Sears? Sears, Roebuck used to be the largest retailer in the United States, with sales representing 1 to 2 percent of the U.S. gross national product for almost 40 years after World War II. Since then, Sears has steadily lost ground to discounters such as Walmart and Target and to competitively priced specialty retailers such as Home Depot and Lowe’s. Even the merger with Kmart in 2005 to create Sears Holding Company failed to stop the downward...

  • Showtime Sound & Lighting (SSL) Inc. is one of three small businesses owned by Tom Smith....

    Showtime Sound & Lighting (SSL) Inc. is one of three small businesses owned by Tom Smith. SSL’s line of business is centered on providing services for the local entertainment industry as well as other organizations such as civic groups and churches in need of support for large gatherings. SSL’s services range from simple DJ services to rental and sale of audio, video, and lighting equipment. Support may be provided on either a continuous or a one-time basis. SSL has noticed...

  • use the information in chapter one to complete it ( in case you do not have...

    use the information in chapter one to complete it ( in case you do not have the book, i post a picture). write a few sentences in each box explaining the extent to which the statements in the left column apply to each of the theories. thank you! Themes and theories Constructivism (Piaget) Social constructivism (Vygotsky) Bioecological systems theory (Bronfenbrenner) nta The environment plays an important role in development Innate factors drive development Development follows a smooth continuous path ning...

  • Subject: HRM Introduction and Instructions You have recently been hired as the Director of Human Resources...

    Subject: HRM Introduction and Instructions You have recently been hired as the Director of Human Resources for Wilson Brothers Canada and have HR responsibility for all of the company’s Canadian operations. Bob and John Wilson have asked you to prepare a report for their review focusing specifically on organizational behavior within the company. Review the Wilson Brothers Case Scenario in depth and address the required topic listed below in your analysis report. Marks are allocated for thoroughness of coverage of...

  • Please read the article and answer about questions. You and the Law Business and law are...

    Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...

  • Will facebook be able to have a successful business model without invading privacy? explain your answer?...

    Will facebook be able to have a successful business model without invading privacy? explain your answer? could facebook take any measures to make this possible? BUSINESS PROBLEM-SOLVING CASE Facebook Privacy: Your Life for Sale Facebook has quickly morphed from a small, niche haps most obviously. Facebook allows you to keep in networking site for mostly Ivy League college stu- touch with your friends, relatives, local restaurants, dents into a publicly traded company with a market and, in short, just about...

  • Please read case article, "Attention Kmart Shoppers? Into and out of Bankruptcy" and help me come...

    Please read case article, "Attention Kmart Shoppers? Into and out of Bankruptcy" and help me come up with a solution for the case as well as action steps to implement the solution! Thank you!! ATTENTION KMART SHOPPERS? Former Kmart CEO, Charles C. Conaway, failed in his 19-month effort to revive the iconic firm, resulting in the largest retailing bankruptcy filing in history on January 22, 2002 (Davies, et al., 2002). On March 11, 2002, bankrupt Kmart named James B. Adamson...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT