Using Binary Search, find the index of 37 in the following array (the first index is 0). Show the values of le
117010
As there is 22 elements in first call,\nOur first is 0\nmiddle is 11\nend is 21\nNow 11th element is 35 which is less than 37.\nSo now our first is changed to 12\nand middle is 17\nend is 21.\n17th element is 42 which is greater than 37\nSo now we will chage end to 16.\nfirst is 12 and middle is 14.\n14th element is 42>37\nSo we change end to 13, first is 12 and middle is 13.\nNow 13th element is 37. So we will now reurn 13.
415435
nope... 01 (in binary) = 1 (in decimal)\n\nand \n\n10 (on binary) = 2 (in decimal)
793059
give values of -3,-2,-1,0,1,2,3 to x and find the corresponding values of y\nyou get the ordered pairs\nnow plot
790827
main () {char *s, b[100]; while(s=gets(b)) printf (atoi(s)%2 ? "nope&#92;n" : "yep&#92;n");}
696961
It's hard to read your code, but it looks fairly correct, at least in the way it accesses the array.  I don't see a count() method, though. Also, you have = instead of == in your if() conditional. I don't think you want that.
157637
The list may contain more than once the same number.\nthese are all valid lists:\n2 1 3 5 9\n1 1 1\n-5 0 -5 0 -5 1 5\n\nThe algorithm will be O(n) (you have to examine every element at least once and once is enough).\nc code would be something like this\n\nint *find_last_min(int *list, int length)\n{\n  int i, *min = list; /* assuming the list is not empty */\n  for(i = 1; i < length; ++i)\n    if(*min >= list[i])\n      min = list + i;\n  return min;\n}
612325
length = 9\nwidth = 9
917997
Simply loop through the list of numbers and compute:\n\n'number' modulo '2'\n\nIn C, that would be:\n\nnumber % 2\n\nA modulus of 2 would return a '1' for odd numbers, and '0' for even numbers (since even numbers divide by 2 with no remainder, and odd numbers divide by 2 with a remainder of 1).\n\nExample:\n\nint index;\nint numArray[25];\n\n...(store the 25 numbers in the array)...\n\nfor(index = 0; index < 25; index++) {\n     if(numArray[i] % 2) {\n          printf("%d&#92;n", numArray[i]);\n     }\n}
526248
There are many answers to this:\n\n1) Take the string, make a reverse copy of it and compare the strings\n\n2) Pointer to the start index of the string and end index of the string and start comparing till you get strlen/2\n\n.... for more solutions and code you can search the web
560969
23\nif intead of '=' there is +
561240
0.40(35) + 0.60(37) = 36.2
1136505
(7,0) \nXdiff = X1 - X2\nYdiff = Y1 - Y2\nThe first (X1 or Y1) should be the larger number of the 2\nso Xdiff = 4 - -3 = 7\nand Ydiff = 0 - 0 = 0
350177
Sometimes adding some indents will help figure out what's going on.  In your algorithm, you have a lot of nested if and while statements, so space them out like this first to see how each is related to each other (I'm using periods because Yahoo won't show spaces):\n\ni <- 0\nwhile (i < n) do\n...j <- i+1\n...m <- a[i]\n...while (j < n) do\n......if (m > a[j]) then\n.........m <- a[j]\n......end if\n......j <- j + 1\n...end while\n...b[i] <- m\n...i <- i + 1\nend while\n\nYour i is a counter that starts with 0, and your j is a counter that starts with 1.  j will always be more than i.\n\nThe "while (i < n) do" line limits this algorithm to 3 loops, since n is 3.\n\nDirectly after this statement, j is established as a counter, and m is defined to be the i-th element of your matrix.  The next while statement then compares m (the i-th element in the matrix) to the element after this (using j to read the next element).\n\nIf m is larger, then the if statement makes m take on the smaller value.  If m is smaller, nothing happens and j is indexed to the next value.  Then the process repeats itself.  If we get to the end of the matrix and m isn't replaced anymore, it becomes the i-th value in matrix B.  After this, i is indexed to the next element in matrix A and the entire process is repeated once again, until all of matrix A has been checked.\n\nThe result then is that through m, matrix A is sorted least to greatest and is written into matrix B, which is answer (d).
357910
hello!!!!!!!!!! \n1+1 in binary is 10! it's not ten but one zero!!!
730496
iteration1: a = 3, b = 2\niteration2: a = 13, b = 8\niteration3: a = 51, b = 30\nloop exit:  a = 81, b = 30 // condition a = a + b executed before exit
981994
pseudo code sort of, based on C++... easiest for me... I am going to do this with an array of integers because the number of integers read into the program can be different than just three.  This can be easily changed though...\n\nstart program:\n\nint arrayInt[3];  //  places to store three integers\nint largestNumber = 0;  // place to store largest number\ncout << "enter three numbers:  ";   // request for three numbers\nfor (int i = 0; i < 3; i++)\n{     cin >> arrayInt[i]; }    \n// takes the three values from the user's input and stores them in an element in the arrayInt array.\n// so... now you need to compare all of the elements in arrayInt\nfor (int i = 0; i < 3; i++)  // do this three times\n{\n     if ( arrayInt[i] > largestNumber )  \n// comare largestNumber to the current element in the array\n// if it is larger, give largestNumber the value of that element\n     {\n         largestNumber = arrayInt[i] );\n     }\n}\n\n// display the largest number\ncout << "the largest number is:  " << largestNumber << endl;\n\n ******************************************************************\n\n1. initialize variables for the three input integers and a variable to store the largest integer (set this one equal to zero).\n2. ask the user for the three numbers\n3. read the user's input into the variables to store them\n4. compare the values stored in the three variables by either doing it individually (if an array is not used) or with a for loop.  Go through each of the three variables that store the user's input and compare the stored value to the largestNumber variable.  The largestNumber variable should be set equal to 0 since we know that all the numbers will be non negative, therefore 0 is the lowest any of the input numbers can be.  If the value of a variable that stores a user given integer is larger than the largestNumber variable, store the value of the input variable in the largestNumber variable ( largestNumber = inputValue2 ).  As you check all of the three input variables, the largest of all of the values checked will be stored in the largestNumber variable. \n5. tell the user the largest variable
487838
1) Assuming an aritmetic sequence\n\nbn = b1 + (n-1)d \nletting b3=a1 = 20, then b7=a5 = 32, and b25 = b23\na5 = a1 + (5-1)d\n32 = 20 + (5-1)d\n32 = 20 + 4d\n12 = 4d\n3 = d\n\nb25 = a23 = 20 + (23-1)*3\nb25 = 20 + 22*3\nb25 = 20 + 66\nb25 = 86\n=====================================================\n2)\na75 = a1 + (75-1)d; d=-3\n\na75 = 5 + (75-1)*-3\na75 = 5 + 74*-3\na75 = 5 + -222\na75 = -217\n\nSn = n/2(a1+an)\nS75 = 75/2(5 + -217)\nS75 = 75/2(-212)\nS75 = -7950\n===================================================\n3) ????\n\na5 = 5*5 - 4 = 21\na15 = 5*15 - 4 = 71\na25 = 5*25 - 4 = 121\n\nOR MAYBE\n\na1 = 5*1 - 4\na1 = 5 - 4\na1 = 1\na30 = 5*30 - 4\na30 = 150 - 4\na30 = 146\n\nSn = n/2(a1+an)\nS30 = 30/2(1 + 146)\nS30 = 30/2(147)\nS30 = 2205\n================================================\n4)\n\nrth term is nCr-1m^n-(r-1)k^r-1\n\n5th term =\n4C4m^4-(5-1)k^5-1\n4C4 = 1\n\n5th term = k^4