Starting from:

$29.99

Lab 04 - Sorting & Nodes Problems

Lab 04 - Sorting & Nodes Problems
Direction: Submit typed work in the Labs directory of your github repositor or dropbox, or upload to the google classroom
assignment. Each part should be a separate files. The files named should be ''lab4A.txt'' and ''lab4B.cpp'' respectively.
Part A: In class
Your objective is to write an array trace table of the array below for one of the three sorting methods (bubble sort,
insertion sort or selection sort) discussed in the sorting lecture. The table should illustrate the swaps that will occur to
the array when it is the argument for the sorting method. Make sure to indicate which method the table is implementing.
5 6 1 8 4 2 3 9 7
Part B: Take home
Your objective is to write the definition of the function Similar() whose header is
bool Similar(Node<T>* ar1,Node<T>* ar2)
template <typename T>
It returns true if the nodes of ar1 and ar2 in the same position have the same values, but ar1 and ar2 are not necessarily
the same length; otherwise, it returns false.

More products