Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ****** Array Manipulation ******
- #include <stdio.h>
- int main()
- {
- //int count[]={1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- int chngIdx[14+1]
- = {0, 2, 4, 7, 9, 10, 11, 14, -1, -1, -1, -1, -1};
- int ara[14] = {1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 7, 15, 15, 15};
- int idx[6+1] = {0, 1, 2, 3, 4, 5, 6};
- int new[6] = {1, 2, 3, 4, 5, 6};
- /* output ::
- 1 -> 2
- 2 -> 2
- 3 -> 3
- 4 -> 2
- 5 -> 1
- 7 -> 1
- 15 -> 1
- */
- int ara[] = {1, 2, 0, 3, 4, 1, 0, 2, 3, 4, 5, 3, 7, 15};
- //Frequency of each element.
- /*
- BIJON -> sort and count.
- MOJU -> use count array and increase corresponding index by 1.
- MEEM -> Cumulative Summation
- */
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement