Question: YU-GI-OH! For this assignment, you will be provided one text file named monsters.txt containing the description of monsters in the following format: Blue-Eyes White Dragon
YU-GI-OH! For this assignment, you will be provided one text file named monsters.txt containing the description of monsters in the following format: Blue-Eyes White Dragon 3000 2500 The monsters will be read into an array as a struct. Your task is to sort and search accordingly with a given feature (attack or defence).
procedure bubbleSort(A : list of sortable items) n := length(A) repeat swapped = false for i := 1 to n - 1 inclusive do /* if this pair is out of order */ if A[i - 1] > A[i] then /* swap them and remember something changed */ swap(A[i - 1], A[i]) swapped := true end if end for until not swapped end procedure
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
