Hello. I would like to solve task,4,5 today.Please, with detailsTask1: Write the implementation of the global (notmember) method removeElements(StackList S1, intx) that takes a stack and integer value x, and thenremoves elements from the stack until findi

匿名用户 最后更新于 2021-11-29 17:10 计算机类Computing

Hello. I would like to solve task,4,5 today.Please, with details

Task1: Write the implementation of the global (notmember) method removeElements(StackList S1, intx) that takes a stack and integer value x, and thenremoves elements from the stack until finding the value x or thestack becomes empty. The method should return the stack aftermodification.

Example: S1 =

98

11

76

23

12

After executing the method removeElements (S1, 23)

S1:

23

12

Task2: Write the implementation of the global (not member)method WrapQueue(QueueList Q1, int x).The method takes a Queue and integer value X, and then wraps thequeue according to the givenvalue.

Example: Q1 =

32

12

5

6

7

After executing the method WrapQueue(Q1, 3)

6

7

32

12

5

Note: Use the methods defined in the Queue ADT,(enQueue(int val),deQueue(),first()).

Task3: Write the implementation of the global(not member) method RevQue(QueueList Q1, intx). The method takes a Queue and integer value X, andreverses the order of the first X elements in the queue. The methodshould use the Stack structure to reverse the elements order.

Example: Q1 =

50

44

11

22

33

After executing the method RevQue(Q1, 3)

11

44

50

22

33

Task4: Use Big-O notation to analyze theefficiency of the methods that you implemented in tasks 1, 2, and3. Write the time complexity (in terms of Big-O) for each method asa comment in the source code file.

Task 5: Using the data structures you havelearned in this course, develop a management system for students'records in the college. The system should enable users toefficiently store, process/update, and track students’ records. Inorder to achieve this, design and implement the appropriatestructures/Classes/Interfaces/methods with space/time efficiency inmind

The main functionalities of the system:

  1. Insert: inserts a new student record in thesystem
  2. Retrieve: searches for a student record usinga key value/attribute.
  3. Process: performs processing tasks. Themajor processing tasks are: assigning a new GPA, modifying MobileNo, change Speciality.
  4. Print: Prints students' records
  5. Delete: deletes a student record in thesystem
  6. Track: Allows to back track the latestupdated/processed students' records

For each student record, you need toinclude the following attributes (you can add more attributes asneeded):

(Studentid, Name, BirthDate, Mobile, Address, Specialty, GPA)

  • Draw the class diagrams for the system.
  • Implement and test the system. Use a driven menu to display theabove requirements properly.
  • Design and Implement each of the following data structuresalong with their essential operations:
  1. Implement a Singly Linked List to store all students'records.
  2. Implement a Stack for tracking the updated/processedrecords.
  3. Implement a Queue for handling the processing tasks of studentsrecords.

已邀请: