Frequency of each element in an integer array | Brute force | JAVA interview question

preview_player
Показать описание
Frequency of each element in an integer array using Brute force technique. O(n^2)

JAVA interview question

#JAVA
Рекомендации по теме
Комментарии
Автор

very well explained. Thanks, but still i have a confusion on why we have stored visited in arr[j] ??

AkashYadav-tclo
Автор

i have doubt related that you have print elements and their frequency for unique elements that not visited but what about that elements that stored in freq[j] how they print?

kalpshah
Автор

How to do it if time complexity O(N) using brute force

rajrawat
Автор

what will happen if the give array has value of visited that is "-1"

basithnizam
Автор

8
2 0 1 1 1 0 3 1
ans=2 4 1 1
code output=2 4 1 0
how can i handle this case

naushadalam
welcome to shbcf.ru