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)
- {
- }
- }
and recieve number to implement it ?
- public List<int> bubblesort(List<int> a)
- {
- int temp;
- // foreach(int i in a)
- for(int i=1; i<=a.Count; i++)
- for(int j=0; j
- if (a[j] > a[j + 1])
- {
- temp = a[j];
- a[j] = a[j + 1];
- a[j + 1] = temp;
- }
- return a;
- }
ahmed salahPosted Dec 7, 2016, 1:44 PM
ahmed salahPosted Dec 7, 2016, 1:40 PM
Krishna Rajput SinghPosted Dec 7, 2016, 1:40 PM
ahmed salahPosted Dec 7, 2016, 1:19 PM
Khaja MoizuddinPosted Dec 7, 2016, 11:47 AM