Re: just trying to understand....


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]

Posted by kristine on July 30, 2001 at 20:32:17:

In Reply to: just trying to understand.... posted by key vs. data on July 30, 2001 at 19:24:52:

: I'm trying to understand the code the Dr. VW has given for red black trees-- why does he lookup up and insert by key... he makes comparisons like if (key < root->key) If we're inserting by some order of data, shouldn't we compare data instead of keys... Anyone know?

you are ordering the nodes using its keys, not data. data is just whatever you want to store in the nodes but it doesn't determine the location.
does that make sense?



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]