






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: Data Structures and Algorithms; Subject: Management Info Systems Main; University: University of Arizona; Term: Fall 1998;
Typology: Assignments
1 / 11
This page cannot be seen from the preview
Don't miss anything!







Sorting
Sorting Algorithms
— basic algorithms (easy to understand but slow)
— efficient algorithms (faster, harder to explain)
Basic and Efficient Algorithms
— insertion
— selection
— bubblesort (the worst of all! never use it!)
Basic and Efficient Algorithms—
— ShellSort
— HeapSort
— QuickSort
Why I’m telling you all this
Selection Sort Algorithm
for(i=0;i<n-1;i++) {
select the smallest item from among data[i], ... , data[n-1] swap it with data[i]
}
(note: this is how you’ll get algorithms in MIS301, then you translate into code)
Comma Expressions
for (x=0,y=N;x<N&&y>0;x++,y--)
Comma Expression Definition
— LHS is fully evaluated. — If LHS produces a value, the value is discarded. — RHS is fully evaluated. — The type and value of the comma expression is the type and value of the RHS.