No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I have binary search - this one , but i need to change it like this , that it will search : for example we have array {1,10,11,12,15,16,22,22,22,22,30,40} I want to find 22 but not randomly - or it will be first 22(that goes after 16) or last 22 (that … |
|
How can I do it - with pointer and only one loop ? for exmpl function - unsigned int dif(const char *str) [CODE] counter = 0; for(i = 0; i < N; i++) A[i] = 0; do { A[tmp % 10]++; tmp /= 10; } while(tmp); for(i = 0; i … |
|
how can i do it with one loop? [code] void printMat(const int mat[][N], int n) { int i, j; for(i = 0; i < n; i++) { for(j = 0; j < N; j++) printf("%3d ", mat[i][j]); puts(""); } }[/code] |