linked list - duplicates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kalar
    New Member
    • Aug 2007
    • 82

    #1

    linked list - duplicates

    I have an exercise which says:
    create a data type called total integers (double(same) values are not allowed)

    How will i do this?
    I have already a function removeduplicate s from another program which i create,that has as an argument the head of a list and removes the duplicates.
    So in my exercise what is best? to create first the hole list and in the end call removeduplicate s? or should i make a check before i add each node?
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    It depends on how your removeDuplicate s method is implemented, but it seems like using this method may be your best shot.

    Comment

    • ruskalym
      New Member
      • Sep 2007
      • 65

      #3
      If you're not lazy enough, you can implement a sorted list structure, with management of duplicates bound on addiing operation.

      Comment

      Working...