/** * QUESTION 6: LinkedLists (10 marks) * * @return The number of unique doubles in thelist. return 0 if the list is * empty. * * * Example: * * If head -> 4.5-> 5.2 -> 4.5 -> 6.4 -> 1.2 -> 1.2 -> null * * then countUniqueshould return 2 (since 5.2 and 6.4 are unique). * */ public int countUnique() { // To be completed return -1; }
cant use hash sets
/** * QUESTION 6: LinkedLists (10 marks) * * @return The number of unique doubles in the list. return 0 i
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am