Data Structurescamron 2
When you write a program using an abstract data structure, you can complete the design of the program before you determine the actual implementation of the data structure. If you design the interfaces carefully, you should be able to change the way you implement the data structure without affecting the outcome of the program. In this Application, you will write alternative pseudocode implementations of a queue.
A queue is a first-in, first-out list. The queue has two essential operations: enqueue, which appends an entry to the end of the list (called the tail) and dequeue, which returns and removes the first entry in the list (called the head). The queue returns entries in the sequence in which they were added. When you do this in real life, you may refer to it as “standing in line.” Some queue implementations include auxiliary operations that may allow programmers to write simpler code.
- Write pseudocode that represents the abstract functions of the enqueue and dequeue operations. Define and explain any supplementary information needed by your pseudocode.
- Refer to the fixed array implementation in Figure 8.5 of your textbook. Write pseudocode that implements the enqueue and dequeue operations by using a fixed array named Cells. The head of the queue should always be in Cells. Define and explain any supplementary information needed by your pseudocode.
- Refer to the circular array implementation in Figure 8.14 of your textbook. Write pseudocode that implements the enqueue and dequeue operations using this technique. Define and explain any supplementary information needed by your pseudocode.
- What do you see as the advantages and disadvantages of each implementation?
- 8 years ago
- review answers
- ACC 253 FINAL EXAM
- Project managemnt
- American History!
- ACC305 Wk 5 Ethics Case 10-12 on page 553
- for Henry
- A student carefully did a titration to determine the %mass of acetic acid in the vinegar sample. After 50 mL of NaOH was added, no observable change had taken place. What is the procedural error in this experiment?
- Apartment Valuations
- managing and bulding human capital
- CHEM QUESTIONS ONLINE A GOOD AMOUNT MAYBE 40 QUESTIONS