How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask ATLPROG Your Own Question
ATLPROG, Computer Software Engineer
Category: Programming
Satisfied Customers: 7260
Experience:  MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
Type Your Programming Question Here...
ATLPROG is online now

recursive method that can remove duplicate elements

Customer Question

How do I go about creating a recursive method that can remove duplicate elements from a sorted List? The duplicates will be next to each other as the List is sorted already, I am struggling to get it to work in linear time.


Example: List input [2, 5, 5, 6, 6, 7] becomes [2, 5, 6, 7]

Submitted: 4 years ago.
Category: Programming
Expert:  LogicPro replied 4 years ago.
Welcome here
Could you provide the code here?
Is it array or ArrayList?