How to find the frequency of elements in an array | Java array practice programs | Code Body

  Рет қаралды 60,483

CodeBode

CodeBode

Күн бұрын

Пікірлер: 29
@codingHero-h9p
@codingHero-h9p Ай бұрын
you are the life saviour, no one in the youtube gives this explanation, thank you.
@amrath123
@amrath123 2 жыл бұрын
Hi.. Space complexity is an issue here, if you use multiple loops approach
@rupeshtiwari527
@rupeshtiwari527 3 жыл бұрын
finally understood thank you
@venkatraju2863
@venkatraju2863 Жыл бұрын
thanks mam..understood finally
@gangadharveeravalli6290
@gangadharveeravalli6290 Жыл бұрын
Finally Im cool with This explanation
@shivam7164
@shivam7164 3 жыл бұрын
can we put some other value instead of -1 in (int visited) please tell if possible
@CodeBode
@CodeBode 3 жыл бұрын
The reason for taking -1 is that it should not conflict with any other number in array. If you take any other number and if that number is present in array the output will be wrong so if it is integer array any negative value or value that is not going to be present in array will work
@shivam7164
@shivam7164 3 жыл бұрын
@@CodeBode so we can take -2 also?
@CodeBode
@CodeBode 3 жыл бұрын
Yes
@livelovelaugh7282
@livelovelaugh7282 3 жыл бұрын
How to do this same program using inheritance
@thetruth5672
@thetruth5672 2 жыл бұрын
@@shivam7164 The idea to take any marker. The value that you know won't occur in array. It can be -10, it can be 100. Etc.
@gauravborse7510
@gauravborse7510 2 жыл бұрын
super explained thank you
@MaheshSharma-ti4pq
@MaheshSharma-ti4pq 2 жыл бұрын
Getting error with this code...with ArrayIndexoutOfBounds...
@alphabee8171
@alphabee8171 2 жыл бұрын
it usually happens when you access element greater than array length(keep in mind array indexing starts from 0 to n-1)
@korebhagath3976
@korebhagath3976 2 жыл бұрын
Madam element tesukoni explain cheyochuga madam ex array [I] = 2 then process going like that
@sachinkore974
@sachinkore974 2 жыл бұрын
how to solve this que with 0(n)
@Divinetots
@Divinetots 3 жыл бұрын
best of all ty.
@aishwaryalakshmid7416
@aishwaryalakshmid7416 2 жыл бұрын
Understood. Thanks.
@thetruth5672
@thetruth5672 2 жыл бұрын
Awesome
@mithank2666
@mithank2666 2 жыл бұрын
thank you
@lamiebevis3189
@lamiebevis3189 3 жыл бұрын
Why are u using new array?
@torkemon
@torkemon 3 жыл бұрын
Life saver
@gandlasamaikya6626
@gandlasamaikya6626 3 жыл бұрын
❤️❤️
@PathimelaArun
@PathimelaArun 3 жыл бұрын
This is not efficient method as it's gets O(n^2)time complexity
@CodeBode
@CodeBode 3 жыл бұрын
True this is not the most efficient just one of the way to find the frequency. Thanks for the comment. Keep learning!
@nityaashukla975
@nityaashukla975 2 жыл бұрын
@@CodeBode mam please do the same program with any other method
@Iceberg_Farigamu
@Iceberg_Farigamu 2 жыл бұрын
Not the most efficient way but I don't see your example posted.
@Samtsjjsj
@Samtsjjsj 3 жыл бұрын
copy paste from Javatpoint :p :p
Un coup venu de l’espace 😂😂😂
00:19
Nicocapone
Рет қаралды 13 МЛН
"كان عليّ أكل بقايا الطعام قبل هذا اليوم 🥹"
00:40
Holly Wolly Bow Arabic
Рет қаралды 14 МЛН
Smart Sigma Kid #funny #sigma
00:14
CRAZY GREAPA
Рет қаралды 58 МЛН
Mom had to stand up for the whole family!❤️😍😁
00:39
Futures Summit 2024 | Immersive Learning: A Cross Disciplinary Approach
48:26
California Community Colleges
Рет қаралды 1
Java Program to left rotate the elements of an array
9:04
Code With Murad
Рет қаралды 34 М.
Learn Java in 14 Minutes (seriously)
14:00
Alex Lee
Рет қаралды 4,8 МЛН
15 - Java program to sort elements of an array in Ascending/Descending order
11:14
Software Testing And Automation
Рет қаралды 47 М.
Un coup venu de l’espace 😂😂😂
00:19
Nicocapone
Рет қаралды 13 МЛН