Description
BLG 233E DATA STRUCTURES
HOMEWORK – 2
In this homework, you will write a program which assigns e-mail address for ITU’s new students. The program accepts one input file named as: “newStudentsList.txt”. The file contains new students’ names and surnames. You have to read the file and create a circular linked list which must be sorted alphabetically by surname.Then, youhave to create doubly linked lists for every surname in the surnameMap. Each doubly linked list consists of nodes of “studentInfo” structure which represent the people with same surname. Definition of the structures are:
structsurnameMap (contains surname information and related pointers). structstudentInfo (contains name, surname and email information and related pointers).
You have to implement the following methods with appropriate arguments for new students’ operations which are not in the file. (We will test your functions manually usingall the operations and a different “newStudentsList.txt” file.)
createList():Creates surnameMapcircular linked list.
insertAll():Inserts all records and information from any file to the lists.
insertNewRecord():Inserts a new record takes information as input parameter.
deleteStudent(): Deletes the studenthaving the given information (this information is taken as parameter) from studentInfo list. If all records having the same surname, are deleted, then delete that surname node from the surnameMap list.
deleteSurnameNode():Deletes the surname node having the given “input_surname”. Please be careful that if this surname node has its own studentInfo list, you should firstly delete studentInfo nodes.
updateList():If a student changes his/her name/surname, update the variable onthelists.
writeToFile() : Writes the latest version of the list with the expected format to “emailList.txt” as an output.
*The lists should be sorted after insert, delete and update operations.
Program Work Flow
1. There is NO restriction about method names and their input/output parameter set. Only make sure that, your methods should work properly and defined 2 structures must be used with given names. A sample main menu is given below:
2. You have to assign all your records to a circular linkedlist which named surnameMap. And then, createdoubly linked lists named as studentInfopointed by every surnameMap node (for the students with same surname), and built a multi-list.
(Creation logic of e-mail address)
For example: Creation ofthelist with records from the file.
1 record has been addedwhich is “Ali AK”.
Program assigns ak@itu.edu.traddress for thegiven request.
1 record has been addedwhich is “Alp AK”.
Program assigns aka@itu.edu.traddress for the given request.
1 record has been addedwhich is “Alper AK”.
Program assigns akal@itu.edu.traddress for the given request.
1 record has been addedwhich is “Ece AK”.
Program assigns ake@itu.edu.traddress for the given request.
1 record has been addedwhich is again “Ali AK”.
Program assigns akali@itu.edu.traddress for the given request.
1 record has been addedwhich is again “Ali AK”.
Program assigns akali2@itu.edu.traddress for the given request.
Submission
1. Make sure you write your name and number in all of the files of your project, in the following format:
/* @Author
* Student Name: <student_name>
* Student ID : <student_id>
*/
2. Use comments wherever necessary in your code to explain what you did.
3. Compile the code in the Secure Shell Client (SSH) before you send your homework.
HOMEWORKS SENT VIA E-MAIL WILL NOT BE GRADED.




Reviews
There are no reviews yet.