Write a bubble sort in c that uses swap to interchange the


Problem

1. Consider a generic function swap (x, y) which interchanges the values of its two arguments. Write a bubble sort in C++ that uses swap to interchange the elements. How would your solution be different if you try the same approach in Ada?

2. Without generics, if we have m data types, n algorithms, and p data types, we need to write on the order of m*n*p library components to support all possible algorithms on all possible data structures for all possible data types. Explain how the use of generics reduces the number of library components that need to be written. Assuming that we could write all the components without generics, what other deficiency remains?

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write a bubble sort in c that uses swap to interchange the
Reference No:- TGS02679971

Expected delivery within 24 Hours