you are the life saviour, no one in the youtube gives this explanation, thank you.
@amrath1232 жыл бұрын
Hi.. Space complexity is an issue here, if you use multiple loops approach
@rupeshtiwari5273 жыл бұрын
finally understood thank you
@venkatraju2863 Жыл бұрын
thanks mam..understood finally
@gangadharveeravalli6290 Жыл бұрын
Finally Im cool with This explanation
@shivam71643 жыл бұрын
can we put some other value instead of -1 in (int visited) please tell if possible
@CodeBode3 жыл бұрын
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
@shivam71643 жыл бұрын
@@CodeBode so we can take -2 also?
@CodeBode3 жыл бұрын
Yes
@livelovelaugh72823 жыл бұрын
How to do this same program using inheritance
@thetruth56722 жыл бұрын
@@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.
@gauravborse75102 жыл бұрын
super explained thank you
@MaheshSharma-ti4pq2 жыл бұрын
Getting error with this code...with ArrayIndexoutOfBounds...
@alphabee81712 жыл бұрын
it usually happens when you access element greater than array length(keep in mind array indexing starts from 0 to n-1)
@korebhagath39762 жыл бұрын
Madam element tesukoni explain cheyochuga madam ex array [I] = 2 then process going like that
@sachinkore9742 жыл бұрын
how to solve this que with 0(n)
@Divinetots3 жыл бұрын
best of all ty.
@aishwaryalakshmid74162 жыл бұрын
Understood. Thanks.
@thetruth56722 жыл бұрын
Awesome
@mithank26662 жыл бұрын
thank you
@lamiebevis31893 жыл бұрын
Why are u using new array?
@torkemon3 жыл бұрын
Life saver
@gandlasamaikya66263 жыл бұрын
❤️❤️
@PathimelaArun3 жыл бұрын
This is not efficient method as it's gets O(n^2)time complexity
@CodeBode3 жыл бұрын
True this is not the most efficient just one of the way to find the frequency. Thanks for the comment. Keep learning!
@nityaashukla9752 жыл бұрын
@@CodeBode mam please do the same program with any other method
@Iceberg_Farigamu2 жыл бұрын
Not the most efficient way but I don't see your example posted.