[solved]-Ve Struggling Alot Working Data Structures Drracket M Hoping Get Help Solving Question 2 B Q39084570
I’ve been struggling alot with working with data structures inDrRacket. I’m hoping I can get some help solving question #2 a), b), and c)
.
2. Summarizing Data. 3 Write a function (remove-item L item) that returns L with all copies of item removed. (remove-item (list 42 “a” “bee” “sea” “bee” 17) “bee”) => (list 42 “a” “sea” 17) Exercise Exercise Ü Write a function (count-item L item) that counts how many values in L are equal to item. (count-item (list 42 “a” “bee” “sea” “bee” 17) “bee”) => 2 Remember, you may use any of our tools so far. Does one of our higher order functions help a lot? Recall the following data definition: (define-struct asc (key val)) ; ; An Asc is a make-asc Any Any) ;; a Dict (dictionary) is a (listof Asc) Exercise Write a function (summarize L) that consumes a (listof Any) and returns a Dict. Each different value from L appears in the answer just once, with the value being the value from L, and the count being the number of times that value appears in L. The items occur in order of first appearance. For example, (summarize (list “b” “X” “b” “c” “b” “c”)) => (list (make-asc “b” 3) (make-asc “X” 1) (make-asc “c” 2)) Show transcribed image text 2. Summarizing Data. 3 Write a function (remove-item L item) that returns L with all copies of item removed. (remove-item (list 42 “a” “bee” “sea” “bee” 17) “bee”) => (list 42 “a” “sea” 17) Exercise Exercise Ü Write a function (count-item L item) that counts how many values in L are equal to item. (count-item (list 42 “a” “bee” “sea” “bee” 17) “bee”) => 2 Remember, you may use any of our tools so far. Does one of our higher order functions help a lot? Recall the following data definition: (define-struct asc (key val)) ; ; An Asc is a make-asc Any Any) ;; a Dict (dictionary) is a (listof Asc) Exercise Write a function (summarize L) that consumes a (listof Any) and returns a Dict. Each different value from L appears in the answer just once, with the value being the value from L, and the count being the number of times that value appears in L. The items occur in order of first appearance. For example, (summarize (list “b” “X” “b” “c” “b” “c”)) => (list (make-asc “b” 3) (make-asc “X” 1) (make-asc “c” 2))
Expert Answer
Answer to I’ve been struggling alot with working with data structures in DrRacket. I’m hoping I can get some help solving question… . . .
OR

