This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Swapping without using a temporary variable in C | |
* (Addition & Subtraction) | |
**/ | |
#include<stdio.h> | |
int main(void) | |
{ | |
int a = 5, b = 10; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Divide : Partition the array A[low....high] into two sub-arrays | |
* A[low....j-1] and A[j+1...high] such that each element | |
* of A[low....j-1] is less than or equal to A[j], which | |
* in turn is is less than or equal to A[j+1...high]. Compute | |
* the index j as part of this partitioning procedure. | |
* Conquer : Sort the two sub-arrays A[low....j-1] and A[j+1....high] | |
* by recursive calls to quicksort | |
**/ | |
#include<stdio.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Divide : Divide the n-element array into two n/2-element | |
* sub-arrays | |
* Conquer : Sort the two sub-arrays recursively using | |
* merge sort | |
* Combine : Merge the two sorted subsequences to form the | |
* sorted array | |
**/ | |
#include<stdio.h> |
NewerOlder