Posts by Cristiane Dos Santos Costa • 329 points
6 posts
-
1
votes1
answer1714
viewsQ: How to create a vector that displays the frequency of each element in a matrix?
"Write a method frequency which receives data from a matrix A that has integers between 0 and x; generates a vector with the occurrences of each integer between 0 and x. Write a method greater that…
-
5
votes1
answer9847
viewsQ: How to create string vectors in java?
"Make an algorithm to receive an integer n (number of students), an integer m (number of subjects), and nxm grades from 0 to 10, which each student obtained in each discipline. Present: a) which (or…
-
5
votes2
answers6555
viewsQ: How do I check if two strings are anagrams of each other?
I need to buy two strings and check if the second one is an anagram of the first one. I thought I’d use FOR repeat loops. I think you should first check if both are the same size, then go through…
-
5
votes2
answers6174
viewsQ: How to count the frequency of each letter in a string?
I need to count the relative frequency of each letter in a string (only letters), without considering the spaces, without differentiating between upper and lower case and without differentiating…
-
4
votes1
answer1566
viewsQ: Print integer combinations in ascending order
"Given two nonnegative integers m and n, generate all combinations of integer size m from 0 to n-1, in ascending order. Example: m=3 and n=5 (0 1 2); (0 1 3); (0 1 4); (0 2 3); (0 2 4); (0 3 4); (1…
-
2
votes1
answer90
viewsQ: How do I avoid infinite loopings in an array?
"Mount an F matrix of size n x n representing a forest. Each element of this matrix can have 3 values: 0 - if empty 1 - contains a tree 2 - contains fire With probability p, given by the user, put a…