Method 1) Hash Map
Insert the entire element
Key……………………Data
Element……………….Number Of occurrence
Once the data has been processed, the number of occurrence can be checked. If the number of occurrence is odd number then that is the required element
Method 2) Sorting with known range
If range is known, then counting sort can be modified. Please refer Counting Sort
Method 3) Digital Logic
EXOR all the element, only odd occurrence will remain. EXOR will flush all the elements that are present for even number of times.

Leave a Reply
You must be logged in to post a comment.