Sunday, October 5, 2014

Send feedback monitronics Cancel reply


The stack can be as simple as 1 bucket imagine that when you put the disc into the turn when you want to remove the disc, you are required to take the turn from the top to the next one. That is why it is also known as Last In, First Out.
From line 13 to line 19 as a function put one element on the stack, monitronics with the stack's input variables and values to be included monitronics in GT (or say one way is to put something else on (gt), where to put (the stack s)). This function returns 1 if the value was successfully introduced into the stack and returns -1 if the stack is full (full stack depending on the number of elements that we allow MAX, we declared above MAX = 30, as So do not be put into 31 elements).
From line 21 to line 30 is function takes one element out of the stack. Like I explained monitronics at the beginning, we can only take turns off the stack elements that can not be taken arbitrarily one element, and the element is added after the first will be removed.
return in line 27 instead of 1, you can use the return gt; But when you want to check the value back awkwardly when one could want to retrieve element value by -1, the value returned when no element in the stack. Therefore, within the framework of this exercise, as desired subject article, in its 25 lines to print out values that have always taken out of the stack. So it is much simpler.
From lines 31 to 42 as a function of converting 1 decimal numbers to binary monitronics using stack and taking monitronics advantage of nature Last In, First Out to make one of the resulting binary form. This function is valid input stack s used to store the results of the first division and the balance obtained in the first number in the decimal monitronics system data. In line 33 we put on the stack s result of the division of residual data obtained by 2 On line 38, the data at will by the result of dividing monitronics the raw data obtained. In lines 39 to 41, we check if the data is not equal to 0, then continue monitronics the recursive call of this function, but the input data value at this time has been reduced by one half compared with the data before it. As a result, after performing the function, the stack S contains elements include 1 or 0, and when taken in a turn and we will be in the binary monitronics number.
Lines 48 to 56 we enter the first number of arbitrary elements from the keyboard onto the stack, after line 56, you get 1 stack not all elements have entered. The first element is index 0 and the last element will be sopt-1 index.
Lines 62 to 69 require keyboard input 1 and number of decimal system used nhiphan function (...). Above to switch to binary. In line 64 nhiphan use function (...) with the stack's input, the input is EMPTY and 2 is the number entered from the keyboard in the form of a cross. After 64 lines will be 1 stack s with elements monitronics including 1 and 0 Actually this function do not return to the entered number in binary form, but the results are printed to the screen has been processed through the stack so that it is the number monitronics of binary, line 67 -> 69 carried out in this work. 1 Note that if you delete lines 57 to 61, the results will definitely monitronics wrong because then stack s still the element. Understanding the exact situation that currently holds variables is 1 important thing to solve the problem.
Send feedback monitronics Cancel reply
Recent Posts On graduation exam and submit monitronics reports to review PTTKHT Filing School monitronics graduation semester Point III - Retest - Test Plan graduation, schooling and Point III semester
Archives August 2012 (1) July 2012 (1) June 2012 (6) May 2012 (5) April 2012 (2) March 2012 (7) February 2012 (7) January 2012 (3) December 2011 (7) November 2011 (10) October 2011 (13) September 2011 (8) August 2011 (3) July 2011 (4) June 2011 (13) May 2011 (8) April 2011 (13) March 2011 (17) February 2011 (5)
% D bloggers like this:

No comments:

Post a Comment