Documente Academic
Documente Profesional
Documente Cultură
Sort number
Sorting Algorithms:
1. The output is in no decreasing order (each element is no smaller than the previous
element according to the desired total order).
2. The output is a permutation (reordering) of the input.
• Merge sort:
Microprocessors CENG405 Done By :
2018- 2019 Nabil Mohsen ALzeqri
Dr. Sami Al-maqtari ID : 61330237
• Heap sort:
Mips code:
.globl main
main:
#printing Name and ID
li $v0,4 #load command to print string
la $a0,msg0 #print string msg
syscall #make system call
#printing Name and ID
li $v0,4 #load command to print string
la $a0,msg #print string msg
syscall #make system call
#printing message 1
li $v0,4 #load command to print string
la $a0,msg1 #print string msg1
syscall #make system call
#read integer for size
li $v0,5 #load command to read number
syscall #make system call
move $s0,$v0 #storing size into $s0
#printing message 2
Microprocessors CENG405 Done By :
2018- 2019 Nabil Mohsen ALzeqri
Dr. Sami Al-maqtari ID : 61330237