Java: Unique Items in an array -


I can not wrap my brain around it, but when I say that I got array with different elements in it is . If I want to create another array with only unique elements from the first array, how will I do this without using the maps, hashets etc. (without importing anything from Java).

Simple brute force algorithm.
Double loop over the array and check whether the element has been repeated or not. Do not include it in the array and continue. O (N ^ 2) Instead of complexity, use a map or set / P>

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -