Changes

Jump to navigation Jump to search
215 bytes added ,  19:26, 13 December 2016
no edit summary
Line 1: Line 1: −
'''Algorithms''' are a type of technology used in multiple fields of study that dictate or alter streams of information (in this case we will most be referring to computer science). The code/pseuocode presented on here will be written in Python.  
+
'''Algorithms''' are a type of technology used in multiple fields of study that dictate or alter streams of information (in this case we will most be referring to computer science). The code/pseuocode presented on here will be written in Python (### syntax in the code represents comments made in Python code).  
    
Case Uses  For Implementing Algorithms (Engineering and Computer Science) :  
 
Case Uses  For Implementing Algorithms (Engineering and Computer Science) :  
Line 31: Line 31:  
     position = index
 
     position = index
   −
     while position>0 and alist[position-1]>currentvalue:
+
     while position>0 and alist[position-1]>currentvalue: #print integers in natural order[-1] less than the previous number
 
       alist[position]=alist[position-1]
 
       alist[position]=alist[position-1]
 
       position = position-1
 
       position = position-1
Line 37: Line 37:  
     alist[position]=currentvalue
 
     alist[position]=currentvalue
   −
alist = [54,26,93,17,77,31,44,55,20]
+
alist = [54,26,93,17,77,31,44,55,20] ### this is the array of integers that will be sorted in natural order 0-infinity
 
insertionSort(alist)
 
insertionSort(alist)
 
print(alist)  
 
print(alist)  
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu