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    ...

variable in c

Variable

A variable is a place to store a piece of information. Just as you might store a friend’s phone number in your own memory, you can store this information in computer’s memory. Variables are a way to accessing computer’s memory. C programming Language strictly imposes rules on how you can manage a variable name:
       Variables name must begin with a letter or underscore
       Variables name are case sensitive that is variable “mynum” is different from variable “MYNUM”
       Variables name does not have spaces
       Variables name must not be C programming language reserved words such as int, float, for, if etc but can use reserved words in middle of variable name such as foreign, integer etc

Variable Type

A variable type is a description of kind of information a variable will store. Following are some of the types that a variable can have:
Data Type
Keyword Used
Example
Declarations/Assigning Value
Integer (whole numbers)
int 
11
int a; int a = 11;
Floating Point (Decimal Numbers)
float
3.9
float b; float b = 3.9;
Character (Characters)
char
M
char c; char c = ‘M’;

Comments

Popular posts from this blog

simple calculator apps project in android studio

Arrays in C Programming Language

Pointers in C