Dat Structres Report2 (Due date: May. 10)Problem solving manualy
1. P41 exrcise 1. (b)2. P41 exrcise 5.3. Compare the two functions n
3 and 38n+12 for various values of n. Detrine hen the second function becomes maler than the first. 4. p127 exrcise 4.
5. p136 exrcise 1. (b), (d) (construct he tables as hown i Figure 3.15)6. Evalute the folwing postfix notaion. (construct he tables as hwn i Figure 3.14)
(a) a b c /- c + (b) a b * c d e /+ a c * +
Programing (C language)1.String Procesing a) Write a function, strdel, that cepts a string and a charcter. The function returns tring with te first ocurence of charcter emoved.
e.g.) strdel(“difernt view”, f) => difernt view b) Write a function, strcnt, that cepts a string. The function returns the number of curences of al the vowels (a, e, i, , u). e.g.) strcnt(“What nice day.”) => a:3 e:1 i:1 o:0 u:0
•Test above functions thorughly using suitable dat. (At least hre difernt est case for each function.)
2. Write functions for the transpose algorithm I, I, and I in the clas nte. •The inputs of the functions are the compresion method types.
•est hes prgrams with te sparse atrix shwn belw. •Print, in the copresion method type, the contets of the matrix before and after the transpose fr al the algrithms.
3. Write a program that finds al the ntrance to exit paths in a maze. • Test he prra with te maze shown belw. • Must print al the paths ont the given maze.
4. Write a program, using the folwing functions, that reads two polynomials and prints the polynomials befre and after the aditon. a) polyRead - ead in a polynomial nd convert it o its linked list represntaion.
Return a pinter t the header node f this polynomial. b) polyWrite - Outpt a polynomial using a form. that clearly displays it.
c) polyAd - Cmpute c = a + b. Do not change ither a or b. wher, a, b, c, are plynmial pointers.
• Test he program with te folwing polynomials. Polynomials are iven through te keybard as inputs. 5x+7x4-3x-x2+9[space] +2[space]
Wher, [space] indicates the nd of a polynomial.
entrance
exit
5. Write functions whic perform. acording to the folwing descriptions. The input each function is a dubly cirular linked list of charcters. a) delte-Deltes al the input charcter in the linked list.
e.g.) delte(lst, b) wher lst is an pointer to a linked list and b is a charcter. b) insert-Inserts a charcter to the linked list. e.g.) insert(lst, b)
c) printfb -pirnts the contet of the linked list both forward and backward. e.g.) printfb(lst)
• Test he functions as hown below.1) Construct he linked list from a set of charcters {j k lr s r ts k u r n j} that is tred in an ary. 2) Then randoml selct one charcter from the set and elte this charcter(s) from the linked list. ※Use rand() functin (excute srand(time(NUL) first).
3) Print he contet of the linked list. 4) Repat 2) and 3) tw more times.
•Submit he folwing in hardcopy (printout) in clas. a) solution f problem solving manualy part b) the prgram (surc cde) and test results of programing part •Send the program (source code) only to