How recursive bubble sort work

                                              Recursive Bubble Sort Base Case: If array size is 1, return. Do One Pass of normal Bubble Sort. This pass fixes last element of current subarray. Recur for all elements except last of current subarray. Example: Index=     0 1  2 3 4 5 6 7   100                          90 80 70 60 50 40 30  Array []= Suppose we want to sort the above in the increasing order by the recursive bubble sort. Make a get grater which will return the grater of the array. Compare the first and last element of the array if the first is greater than last the swap with each other. And again call the sort function and decrement the array size by 1; 1) 30                     90 80 70 60 50 40 100    ...

ARITHMETIC OPERATORS IN C


Arithmetic operators are commonly used in a variety of programming languages. In C, there are five of them and they all take two OPERANDS – an expression that is required for an operator to work. For example, for 2 + 3, 2 and 3 are considered as operands. The following table shows Arithmetic Operators:
Operator Name
Symbol
Multiplication
    *
Division
    /
Addition
    +
Subtraction
    -
Modulus
    %

In addition to division operator, C also provides modulus operator (%) which returns remainder on dividing one integer with another. Thus the expression 10/2 yields 5, whereas 10%2 yields 0. Modulus operator cannot be applied on float. Also using %, sign of remainder is always the same as sign of numerator. Thus -5 % 2 yields -1, whereas 5 % -2 yields 1.

Comments

Popular posts from this blog

simple calculator apps project in android studio

Arrays in C Programming Language

Pointers in C