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;
- }
Khaja MoizuddinRank #270 · 9.4K reputationPosted Dec 7, 2016, 6:47 AM EST
ahmed salahRank #2,612 · 534 reputationPosted Dec 7, 2016, 8:19 AM EST
Krishna Rajput SinghRank #605 · 4K reputationPosted Dec 7, 2016, 8:40 AM EST
ahmed salahRank #2,612 · 534 reputationPosted Dec 7, 2016, 8:40 AM EST
ahmed salahRank #2,612 · 534 reputationPosted Dec 7, 2016, 8:44 AM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts