The Repo for task submission
Task_v2.0(Group Activity): http://www.github.com/ ---- Clone/Fork a common github repo to your local system The basic idea of this task is to understand how collaborated projects work on github .
Terminal: After cloning the repo you’ll be given a particular algorithm to implement in your favourite programming language Code the algorithm and then push the file to the repository. After pushing the code, finally put a pull request. Your pull request will then be reviewed by the collaborator. If everything is fine and your mentor is convinced and contented your request will be approved. Finally, you are now a contributor and you’ve conquered the BATTLEGROUND. Congrats you are now a git enlightened !!!
The algorithm to be implemented is Modular Exponentiation. Read about it, if you guys don't know it. It's a really simple implementation and optimising algorithm, which would be essential in many competitive contests!
Pull requests will be verified and accepted by Shashvat or me.
Have fun and happy coding!!
heapsort.c
1)taking array size and array elements as input
2)heapifying array from bottom of heap by comparing left and right childs of elements by using heapify function
3)after heapifying keeping top element of heap into another array and replacing least element of heap to top position of heap.
4)last element of heap will be palced with some large negitive junk number so,that further it cannot distrub next step of heapifying.
5)printing another array in which all heap elements placed.
6)to sort co-ordinates(giving first preference to x co ordinate and next preference to y co ordinate)give input as x.y(float)so,automatically while sorting x will be given first preference if x is same then we will check y(decimal) value to sort.
quicksort.c
1)taking array size and array elements as inputs
2)quicksort(): taking first element as pivot and by using i,j swapping larger numbers on left side of pivot with smaller numbers on rightside.
3)swapping pivot to its apropriate position from first position. so that all numbers on leftside of pivot will be smaller than it and all rightside elements of pivot willbe greater than it
4)again repeat same process for left elements of pivot and right elements of pivot.
5)print the final array
6)to sort co-ordinates(giving first preference to x co ordinate and next preference to y co ordinate)give input as x.y(float)so,automatically while sorting x will be given first preference if x is same then we will check y(decimal) value to sort.
randomised quicksort.c
1)same as of quickort.c
2)randomise the array using rand()function.