please answer question in C programming language not c++
Microsoft Word - 352-final-exam-study-guide.docx For some of the coding questions, you can try implementing two versions - one with the standard library functions allowed (which could make it shorter) and another version with no standard library. You should not rely on only this study guide for final exam preparation. Problem 1 In this problem, you should write a C function named bubble_sort. This function should have one parameter of type StringLLNode*. StringLLNode represents a node for a linked list of strings, which is defined as: typedef struct StringLLNode { char* string; struct StringLLNode* next; } StringLLNode; You can expect that the node that gets passed into the function represents the root of a linked list. The function should perform a bubble-sort on the linked list to get the elements into alphabetical order, based on the string contents in each node. Initially, try implementing this with the standard library functions. For example, you could use the strcmp function for comparing if a string is greater than the other. After implementing this, try accomplishing it without any help from standard library functions for additional practice. ‘ Problem 2 In this problem, you should write a C function named build_binary_tree. This function should have one parameter of type char* that represents the name of a file to read from. You can expect that the file will have exactly one word per line, and no word will be longer than 25 characters. The function is responsible for constructing a binary tree from these words, and should return the root node of the constructed tree, which should be a StringTreeNode*. You can expect that a StringTreeNode is defined as: typedef struct StringTreeNode { char* string; struct StringTreeNode* left; struct StringTreeNode* right; } StringTreeNode; The function should read through the strings from the file in order, and add each to the tree. Words that come earlier in alphabetical order should go to the left, and words that go later in alphabetical order should go to the right. For example, if the input file contained the words: dead zebra yelp britain america zoo comic The resulting tree should be: dead / \ britain zebra / \ / \ america comic yelp zoo Problem 3 In this problem, you should write a C function named convert. This function should have one parameter of type char*. You can expect that this parameter will be a string containing only upper and lower case letters. The function should convert any upper-case letters to The character '0' and lower-case letters to '1' in the string that was passed in. The function should not return anything (a void function). Problem 4 In this problem, you should write a C function named count_ones. This function should have one parameter of type unsigned long. The function should count how many 1 digits exist in the binary representation of that unsigned long number in memory and return the count as an int. For example, say that on a test system, an unsigned long was 64 bits, and the unsigned long with the value 25 was passed in. The underlying binary of this would be: 0000000000000000000000000000000000000000000000000000000000011001 The function should return 3 in this case. Problem 5 In this problem, you should write a C function named max_cross. This function should have two parameters: The first of type int** which you can expect to represent a 2D array of signed integer values and the second an int representing the number of rows and columns (you can assume that the 2D array will have an equal number of rows / columns, and every row will have the same number of elements). This function should iterate through every element in the 2D array. For each element, it should sum up all the values in that particular row and column. The function should return the highest of these sums. For example, say that this 3x3 2D array was passed in: { {10, 20, 30 }, {10, 20, 50 }, {50, 15, 40 } } The function should return 185 in this case. This is because the max row/column sum combination is: { {10, 20, 30 }, {10, 20, 50 }, {50, 15, 40 } } Problem 6 In this problem, you should write a C function named binary_tree_to_binary_file. This function should have two parameters. The first should be a NumTreeNode* representing the root of a binary tree with unit32_t values in each node. The second parameter should ba a char* representing the name of a file to write to.. A NumTreeNode is defined as: typedef struct NumTreeNode { uint32_t value; struct NumTreeNode* left; struct NumTreeNode* right; } NumTreeNode; The function should iterate through the tree via in-order traversal, and write each of the value values to the file specified by the second parameter. It should write each number in its binary representation, one after the other. Problem 7 In this problem, you should write a C function named reverse_words. This function should have one parameter of type char* which you can expect will be a string with 0 or more words separated by spaces. The function should reverse each individual word within the string. For example, this code: char words[] = "cheetah elephant cat"; reverse_words(words); printf("%s\n", words); Should print: hateehc tnahpele tac Problem 8 In this problem, you should write a C function named merge_numbers. This function should have two parameter of type char* which you can expect will both be paths to text files containing an equal number of integer numbers values 0 - one billion, one number per line. This function should create a file named numbers.bin. The function should interleave the numbers from the two text files into this binary file, and write each in its 32 bit binary representation. Problem 10 Write a bash command to print out a text representation of all of the pop assembly instructions from an ELF file named runme. Problem 11 In this problem, you should write a short bash script. The script should list all files that end in .o from the /lib directory on a UNIX system, only if the file name (not including the extension) begins and ends with a vowel. Problem 12 Pretend that we have a simple game program called statistics whose source code has the following structure and characteristics: - statistics |- statistics.c |- coremath.c |- coremath.h |- calc.c |- calc.h +- makefile Expect that statistics.c contains the main function. coremath.c contains a collection of function implementations whose prototypes are in coremath.h and calc.c contains a collection of function implementations whose prototypes are in calc.h. statistics.c only includes calc.h and a few standard library header files. calc.c includes only coremath.h. coremath.h does not contain any other includes. When built, the resulting game executable should be named statistics. Write what should go in the makefile that has one rule per output file produced. Problem 13 In this problem, you should write a bash script to complete the following task. The bash script should have one command line argument, that being a path to some directory on the computer. The script should find every file that ends in .c or .h within that directory, and count how many lines are in each. It should print out the name of each file with the number of lines in the files. Problem 14 In this problem, you should write a bash script to complete the following task. The bash script should have one line argument, which you can expect will be the name of a text file. The script should determine how many lines of the file begin with the letter a, b, c . . ., y, z. For each, it should print out the starting letter, accompanied by how many lines start with that. Problem 16 When we run a program with valgrind, it can sometimes display this type of problem definitely lost: X bytes in Y blocks and it can also display this type of problem: Conditional jump or move depends on uninitialised value(s) What do each of these mean? What is the difference between the two? Give an example of each. Problem 17 Match the name of the command to the best-fitting description: sed ls elfdump objdump whoami grep du ps top displays the current user show running processes search for and optionally replace elements in text show processes and what resources those processes are consuming search through text display files show information about ELF executables, including disassembly show information about the sections in an ELF file display sizes of files Problem 19 Recall that behind-the-scenes on a UNIX system, a file is represented by an i-Node. For this problem, assume the following: ● A data block is 160 bytes. ●