Urgent help needed!!How to find Number of distinct elements in an array??
There is a problem I am stuck at, from yesterday. Using any loop(while, do...while, for), how to find the number of distinct elements in an array?
For example, if an array "a[5]" contains 1, 2, 1, 3, 2 then the number of distinct elements is 3. U can use if statement too.
The number of elements is known and stored in a variable "i".
Please someone help, its really urgent!!!
Thanx!
There is a problem I am stuck at, from yesterday. Using any loop(while, do...while, for), how to find the number of distinct elements in an array?
For example, if an array "a[5]" contains 1, 2, 1, 3, 2 then the number of distinct elements is 3. U can use if statement too.
The number of elements is known and stored in a variable "i".
Please someone help, its really urgent!!!
Thanx!
Last edited: