Hmwk2_prob_ch - COMPE 271 HOMEWORK 2 DUE ON 12/2010 Below you are given a C program which sorts 20 numbers(integer in ascending or descending order

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
COMPE 271 HOMEWORK 2 DUE ON 12/_/2010 Below you are given a C program which sorts 20 numbers (integer) in ascending or descending order using three different sort algorithms. These algorithms are insertion sort, exchange sort and bubble sort. The sort algorithms are implemented as three C functions and are given below. The main program calls the three sort functions for sorting three different arrays and prints out the sorted arrays. You are asked to implement the three sort functions in assembly language in windows and/or Linux environment. Please note that you are required to implement all three functions in assembly language. A copy of the skeleton code for assembly functions is also given on the last page of this document. //----------------------------------------------------------------------- // Insertion Sort void insertion_sort ( int numbers[], int max) { int i, j, k; int value; k = 0; for (i = 1 ; i < max; i++) { value = numbers[i]; j = i-1; while (j >= 0 && numbers[j] > value )
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/07/2011 for the course COMPE 271 taught by Professor Staff during the Fall '08 term at San Diego State.

Page1 / 3

Hmwk2_prob_ch - COMPE 271 HOMEWORK 2 DUE ON 12/2010 Below you are given a C program which sorts 20 numbers(integer in ascending or descending order

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online