more topic chapters

Insertion Sort

Psuedocode

 #Coded by Revise Zone | Indenting is required
//ARRAY ALREADY CREATED AND STORED , THE RANGE IS FROM 0 TO 9
FOR POINTER 1 TO (MAX)
    ITEM←ARRAY[POINTER]
    Current←POINTER-1
    WHILE ARRAY[Current]>ITEM AND Current>-1 Do
        ARRAY[Current+1]←ARRAY[Current]
        Current←Current-1
    END WHILE
    ARRAY[Current+1]←ITEM
END FOR 
OUTPUT ARRAY
	
 

This sorting algorithm will only work for arrays that hae numbers stores in it as there must be way to compare the weight of each value in each node. This could be improved for any sorting by converting characters to ASCII values but for school knowledge, this is enough...

Python Algorithm

The code is in python for this algorithm

The code is free for anyone to copy and use...The copied code must have the same code and indentation as above

Try it yourself




Download Py