Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Basic Sorting Techniques

Write a program that does the following sorting techniques: Bubble Sort; Selection Sort; Insertion Sort.
The program should display a main menu, where the user may choose upon.

MAIN MENU FUNCTION


Creates a list by accepting integer values from the user. It will stop accepting
[1] CREATE LIST when it encounters the symbol a period (.). If there is an existing list, ask the
user if he/she wants it to be replaced or not.

Sort the list using Bubble Sort, display all the elements after each pass. Display
[2] Bubble Sort
“empty” if there is no elements in the list.

Sort the list using Selection Sort, display all the elements after each pass.
[3] Selection Sort
Display “empty” if there is no elements in the list.

Sort the list using Insertion Sort, display all the elements after each pass.
[4] Insertion Sort
Display “empty” if there is no elements in the list.

Terminates the program. Display your student number, full name, section and
[5] EXIT
lab exer 3 before exiting the program.

PREPARED BY ABRAHAM MAGPANTAY 1

You might also like