Hi I make function to bubble sort but i need to implement it inside
Main function as following :
- class Program
- {
- static void Main(string[] args)
- {
- }
- }
How to implement bubblesort function inside Main function
and recieve number to implement it ?
- public List<int> bubblesort(List<int> a)
- {
- int temp;
-
- for(int i=1; i<=a.Count; i++)
- for(int j=0; j<a.Count-i; j++)
- if (a[j] > a[j + 1])
- {
- temp = a[j];
- a[j] = a[j + 1];
- a[j + 1] = temp;
- }
- return a;
- }