Compilation of Data Structure and Algorithm Programs GROUP1
Compilation of Data Structure and Algorithm Programs GROUP1
Submitted by:
Roxanne A. Divina
Melody Velasco
Submitted to:
Jeriko G. Pelimiano
I.
Table of Contents:
CONTENTS
II.
A. TITLE PAGE . . . . . . . . . . . . . . . . . . . . .
B. TABLE OF CONTENTS . . . . . . . . . . . . . . . . .
D. PROGRAMS . . . . . . . . . . . . . . . . . .
E. CURRICULUM VITAE . . . . . . . . . . . . . . . . . .
pg. 1
III. BRIEF DISCUSSION ABOUT DATA STRUCTURE AND ALGORITHM:
1. Datatypes: This program demonstrates basic input and output operations with
different data types such as String, int, double, char, and boolean. It utilizes the
`Scanner` class for input.
2.Enumeration Type: This program introduces the concept of enumeration type in Java.
It defines an enum `Color` and then allows the user to select two colors. Based on the
combination of colors chosen, it provides a result by mixing the colors.
4. Bubble Sort: This program implements the bubble sort algorithm to sort an array of
integers in ascending order. It repeatedly steps through the list, compares adjacent
elements, and swaps them if they are in the wrong order.
5. Insertion Sort: This program demonstrates the insertion sort algorithm to sort an
array of integers. It iterates through the array, shifting elements that are greater than
the current element to the right, and then places the current element in the correct
position.
6. Merge Sort: This program implements the merge sort algorithm to sort an array of
integers. It divides the array into two halves, recursively sorts the halves, and then
merges them to produce a sorted array.
7. Selection Sort: This program showcases the selection sort algorithm to sort an array of
integers. It repeatedly finds the minimum element from the unsorted part of the array
and swaps it with the first element.
pg. 2
IV. PROGRAMS:
Datatype:
Samle Output:
pg. 3
Enumerationtype:
Sample Output:
pg. 4
Abstracttype:
pg. 5
Sample Output:
pg. 6
BubbleSort:
Sample Output:
pg. 7
SelectionSort:
pg. 8
Sample Output:
pg. 9
MergeSort:
Sample Output:
pg. 10
InsertionSort:
pg. 11
Sample Output:
pg. 12
V.
CURRICULUM VITAE:
pg. 13
pg. 14