Question
C++ Help in modifying function to update nodes Problem: Help needed to allow the findDupe() function to update a node with the information found in
C++ Help in modifying function to update nodes
Problem: Help needed to allow the findDupe() function to update a node with the information found in the duplicate node.
Input File:
My output AFTER Sorting:
Expected output AFTER Sorting:
My function to find duplicates, right now, it simply removes records that have the same id. Not sure how to make it use updated information
NOTE: There are 3 records in the input file with the same id. If a record has the exact same information as a previous record, it is recognized as a duplicate and deleted. If it has the same id but with different information, in this case, the DOB is different, the node is updated with the new info.
{id: 1234567, first: Mary, last: Green, DOB: 1996-10-03,GPA:4.0) {id: 1234568, first:Peter, last: White, DOB: 1997-05-22, GPA:3.8} {id: 1654238, first: Nick, last:Park, DOB: 1995-08-18,GPA: 4.0} {id: 1234587, first:Katy, last: Green, DOB: 1995-08-18, GPA: 4.0} {id: 1654238, first:Nick, last:Park,DOB: 1995-08-18, GPA:4.0) {id: 1654238, first:Nick, last:Park,DOB: 1995-08-28, GPA: 4.0} Kid: 1234567, first:Mary, last: Green, DOB: 1996-10-03,GPA: 4.0} {id: 1234568, first: Peter, last: White, DOB: 1997-05-22, GPA: 3.8) {id: 1234587, first:Katy, last: Green, DOB: 1995-08-18, GPA: 4.0) {id: 1654238, first: Nick, last:Park, DOB: 1995-08-18, GPA:4.0} Kid: 1234567, first: Mary, last: Green, DOB: 1996-10-03,GPA:4.0) {id: 1234568, first:Peter, last: White, DOB: 1997-05-22, GPA:3.8} {id: 1234587, first:Katy, last: Green, DOB: 1995-08-18, GPA: 4.0} {id: 1654238, first:Nick, last:Park,DOB: 1995-08-28, GPA:4.0) void Linkedlist::findDupe() { //implement //cout set; unordered_set
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started