0% found this document useful (0 votes)
2 views

Algorithm Assignment 1

The document outlines an algorithm assignment that includes describing a standard operation of collections, constructing pseudocode to read and store color names and order indicators from a collection named RAINBOW into two parallel arrays, and sorting the ORDER array while maintaining index correspondence. Additionally, it requires a comparison of bubble sort and selection sort algorithms. The assignment emphasizes understanding data structures and sorting methods.

Uploaded by

arcticflamex
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Algorithm Assignment 1

The document outlines an algorithm assignment that includes describing a standard operation of collections, constructing pseudocode to read and store color names and order indicators from a collection named RAINBOW into two parallel arrays, and sorting the ORDER array while maintaining index correspondence. Additionally, it requires a comparison of bubble sort and selection sort algorithms. The assignment emphasizes understanding data structures and sorting methods.

Uploaded by

arcticflamex
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Algorithm Assignment #1

1. Describe one standard operation of collections.

2. The collection RAINBOW holds the names of the main colors of the rainbow along with their order
indicator, as follows:

Blue, E, Green, D, Indigo, F, Orange, B, Red, A, Violet, G, Yellow, C

Construct an algorithm using pseudocode to read the data from RAINBOW and store the names of the colors in
a one-dimensional string array, COLOR, and the order indicators in another one-dimensional string array,
ORDER. The matching color and order indicator must have the same index in the COLOR and ORDER arrays.

3. Construct an algorithm using pseudocode to sort the contents of the array ORDER into alphabetical
order. The indexes for the corresponding data in the two parallel arrays must remain the same after sorting.

4. Compare and contrast the bubble sort algorithm and the selection sort algorithm.

You might also like