Menu

[solved] – Question 87568

Q3 Example Questions:
For each example question, use a record that contains two fields, id and gpa. id is an integer and gpa is a float. (for the list problem, it also has a NEXT field which is a pointer to the structure). Write a complete program that demonstrates the solution to the problem.

(a) Stack: Create 3 records ( {100,2.0}, {200,3.0}, 300,3.8} ). Use a stack to print them out in reverse order. The stack has a size of 5.

(b)Queue: Create 3 records ( {100,2.0}, {200,3.0}, 300,3.8} ). Insert them in a queue. Empty out the queue and print out the structures. The queue has a size of 5

(c)Write a program that inserts these structures in an ordered linked list. ( {100,2.0}, {200,3.0}, 300,3.8}. The list needs to be ordered by gpa.

Expert Answer


OR


Leave a Reply

Your email address will not be published. Required fields are marked *