Ask a question from expert

Ask now

CSCI 103 Algorithms and Problem Solving

4 Pages395 Words426 Views
   

University Of Wollongong

   

Algorithms and Problem Solving (CSCI 103)

   

Added on  2020-04-29

CSCI 103 Algorithms and Problem Solving

   

University Of Wollongong

   

Algorithms and Problem Solving (CSCI 103)

   Added on 2020-04-29

BookmarkShareRelated Documents
Question 1: Linked Lists a)studentListData structure for list:class student{string IDstring nameint intakechar genderstudent * next}student * startNodeb)i) predecessor: S073593 successor: S073677ii) pseudocode:DECLARE a student pointertempassign temp.ID = S073600assign temp.name = “Joyce Chia”assign temp.intake = ‘F’assign temp.intake = 4assign temp.next = pPre.nextassign pPre.next = tempc)pseudocode:assign pPre.next = pDel.nextassign pDel.next = NULLdelet pDeld)BEGIN DisplayStudents( slist )DECLARE a student pointertempAssign temp = slistDECLARE integer count as 0WHILE temp is not NULLPRINT all details of temp on screenassign temp = temp.nextINCREMENT count by 1
CSCI 103 Algorithms and Problem Solving_1
END WHILEPRINT total number of student as countEND DisplayStudentse)BEGIN DisplayFemaleStudents( slist )DECLARE a student pointertempAssign temp = slistDECLARE integer count as 0WHILE temp is not NULLCHECK IF temp.gender is ‘F’:CHECK IF temp.intake is 5 or 6 or 7:PRINT all details of temp on screenEND IFEND IFassign temp = temp.nextINCREMENT count by 1END WHILEPRINT total number of student asountEND DisplayFemaleStudentsf)BEGIN SearchStudents( slist, studID )DECLARE a student pointertempassign temp = slistWHILE temp is not NULL and temp.ID <= studIDCHECK IF temp.ID is equal to studIDreturn tempEND IFassign temp = temp.nextEND WHILE
CSCI 103 Algorithms and Problem Solving_2

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Implementation of Palindrome check from the words of the file
|7
|531
|1