Problem 1 (100 points)- Create functions Submit 5 files in one folder (gen8 file
ID: 3711659 • Letter: P
Question
Problem 1 (100 points)- Create functions Submit 5 files in one folder (gen8 files (.c and h), hw8 files (.c and .h), README.txt) and the sample files you created in another folder. Zip into one folder. You will be creating functions only. Use any parameters and return values you find necessary. 0 points if you do not do the following: 1. Create sample files to test out yourfunctions. All functions used to help create the functions for the prompts should be kept in gen8 files. ***Hint: most helper functions can be modified or directly used from code done in class. 2. All functions created for the prompts (three below and the bonus ifyou choose to do it) should be kept in the hw8 files. 3. Prompt 1 (25 points): You are playing a card game and holding a hand of five cards. You want to always make sure they are in order from left to right. Create a function that reads in a file of 5 cards and sorts by number (assume there are no aces, kings, queens or jacks-only number cards). A card is represented in the form 3 hearts, where 3 is the number and hearts is the suit. There are 4 possible suits: hearts, spades, diamonds and clubs. If there are two of the same numbers, then use the suit to sort. For example, if you have 3 hearts and 3 diamonds, 3 diamonds should precede 3 hearts A possible function run might look like ---Reading in card info... --Sorting... 2 diamonds 4 spades 7 hearts / spadesis the same spades comes after hearts since s comes arter h 9 clubsExplanation / Answer
There is multiple question I want answer of binary tree prob so that you get bonus point.
void freeTree(struct node* node)
{
if (node == NULL) return;
/* first free both subtrees */
freeTree(node->left);
freeTree(node->right);
/* then free the node */
printf(" Deleting node: %d", root->data);
free(node);
}
here we pass root of binary tree as argument.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.