May I know how to make a function to sort the elements in ascending or descending order using selection sort and insertion sort
Jayakrishna🇮🇳 Can you tell be how Insertion sort is different from Selection sort?
Atul Once go through the link, you can understand it.. Selection Sort is first finds the smallest element in the array and swaps it with the element in the first 0th position, then finds the second and swaps it with second (1st) position, and continues for entire array.. Where as insertion sort, first arrange 1st 2 elements in order. Then next 3rd element is added in ascending order with 1,2. Now 1,2,3 are in ordered. Next 4th element is placed in order with 1,2,3,4 to its needed position.. so 1,2,3,4 is ordered now. This goes on for entire list. hope it helps..
Python — File Handling
Help me solve this (using loop)
What is wrong? Error on test.
Help me wiht python
Question is write a c program to print prime numbers up to n and print the largest number in array.