Skip to content

nqminhuit/java_dsa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Excercise: Student management

how to run

javac *.java -d target; java -cp target Main

how to package into 1 executable jar

javac *.java -d target; jar cfe java-dsa-student-management.jar Main -C target .

to run it:

java -jar java-dsa-student-management.jar

Double linked list operations

  1. insert/add first/middle/last

  2. remove first/middle/last

  3. display (head -> tail)

  4. sort

  5. check for empty

Data structure

  • Student model:

    • id: string, max 10 chars, unique
    • fullname: string, max 40 chars
    • score: float
  • Requirements:

    1. insert students to list

    2. Read student list from file

    3. print student list

    4. print students whose score > 5

    5. Output student whose Id = 'X'

    6. sort by score ascendant

    7. add new student after student id = 'X'

    8. remove first student

    9. remove last student

    10. remove student whose id = 'X'

    11. remove all

Mockup

[id: 111, fullname: batman, score: 10] <-> [id: 212, fullname: superman, score: 8] <-> [id: 123, fullname: tom, score: 4] <-> [id: 123, fullname: jerry, score: 3]

  • item/element structure:

    • student
    • next
    • prev
  • list structure:

    • head: Student
    • tail: Student
  • empty list:

    • head == null == tail

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages