Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Bubble Sort Algorithm There are several algorithms that perform various operations on arrays. However, one of the most common tasks is sorting an array
Bubble Sort Algorithm There are several algorithms that perform various operations on arrays. However, one of the most common tasks is sorting an array to arrange its elements in the correct order, either ascending or descending using a sorting algorithm such as bubble sort. As a Bsc. IT graduate of PIHE, you have been presented with the information of seven (7) managers who heads ABC Mining Corporation contained in the table below: City First Name Adewale Nkosi Thandeka Ndlovu Anthony Dlamini Nosipho Last Name Obaro Hlungwane Noluthando Mabuza Kimberly Nkosana Thabete Source: Obaro A (2023) Johannesburg Pretoria Port Elizabeth East London Cape Town Durban Bloemfontein Age 50 70 40 60 30 55 25 Use the information provided above to answer the questions that follows: 2.1 Describe bubble sort algorithm. (5 Marks) 2.2 Using your knowledge of arrays and classes, write a C# console application to perform a bubble sort on the given data, in such a way that: 2.2 a the Last Names of the managers are alphabetically arranged in ascending order. Show all records before and after the sorting process. Your output should be display in the format below: ::: Before Sorting Obaro Adewale Johannesburg - 50 Hlungwane Nkosi - Pretoria - 70 Noluthando- Thandeka - Port Elizabeth 40 Mabuza - Ndlovu- East London - 60 Kimberly Anthony - Cape Town - 30 Nkosana - Dlamini - Durban - 55 Thabete - Nosipho - Bloemfontain - 25 :::::After Sorting - Bubble Sort Using Last Names Hlungwane Nkosi Pretoria 70 Kimberly Anthony - Cape Town - 30 60 Mabuza - Ndlovu - East London Nkosana - Dlamini - Durban - 55 Noluthando- Thandeka - Port Elizabeth Obaro Adewale- Johannesburg Thabete Nosipho - Bloemfontain 25 50 40 2.2 b the Ages of the managers are numerically used to arrange the records in ascending order, starting from the lowest to the highest age. Show all records before and after the sorting process. Your output should be display in the format below: Obaro Adewale Johannesburg - 50 Hlungwane Nkosi - Pretoria - 70 Noluthando : Before Sorting Thandeka- Port Elizabeth 40 60 Mabuza Ndlovu East London Kimberly Anthony Nkosana Dlamini Thabete - Nosipho - Bloemfontain - 25 Cape Town Durban - 55 End of Question 2 30 :::::After Sorting Thabete - Nosipho - Bloemfontain - 25 Kimberly - Anthony - Cape Town - 30 Noluthando Thandeka Port Elizabeth Obaro Adewale - Johannesburg - 50 Nkosana - Dlamini - Durban - 55 Mabuza Ndlovu East London - 60 Hlungwane - Nkosi - Pretoria - 70 40 Bubble Sort Using Ages of Managers (10 Marks)
Step by Step Solution
★★★★★
3.49 Rating (152 Votes )
There are 3 Steps involved in it
Step: 1
Lets start by addressing each part of the question beginning with 21 21 Describe bubble sort algorithm Bubble sort is a simple sorting algorithm that repeatedly steps through the list compares adjacen...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started