Skip to content
Snippets Groups Projects
Commit 0191b0c3 authored by Miguel Espino's avatar Miguel Espino
Browse files

added student info and redid my if statements

parent 00838b97
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* @date: July 2023 * @date: July 2023
*/ */
/* Miguel Espino | lfc083 | 11352639 */
#include <qsort.h> #include <qsort.h>
/* returns -1 if first < second /* returns -1 if first < second
...@@ -20,8 +22,12 @@ int compareDouble(void *first, void *second) ...@@ -20,8 +22,12 @@ int compareDouble(void *first, void *second)
if(dFirst < dSecond){ if(dFirst < dSecond){
return -1; return -1;
} }
return (dFirst > dSecond); else if (dFirst > dSecond){
/* fill in the details of comparing 2 doubles */ return 1;
}
else {
return 0;
}
} }
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* @date: July 2023 * @date: July 2023
*/ */
/* Miguel Espino | lfc083 | 11352639 */
/* returns -1 if first < second /* returns -1 if first < second
* returns 0 if first == second * returns 0 if first == second
...@@ -22,12 +23,14 @@ int compareInt(void *first, void *second) ...@@ -22,12 +23,14 @@ int compareInt(void *first, void *second)
iSecond = *(int*)second; iSecond = *(int*)second;
if(iFirst < iSecond){ if(iFirst < iSecond){
return -1; return -1;
} }
return (iFirst > iSecond); else if (iFirst > iSecond){
/* fill in details of comparing 2 integers */ return 1;
/* look at complexComp.c for the idea behind this solution */ }
else{
return 0;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment