Help me with these Dr.Racket problems please. Dr.Racket is \"PLT Scheme programm
ID: 3862400 • Letter: H
Question
Help me with these Dr.Racket problems please. Dr.Racket is "PLT Scheme programming language". I have to write a function for each question below. I'm new to Racket and stuck on these problems.
Most functions to remove duplicates from a list check to see if the element is in the rest of the list, and make use of structural recursion. Write a function using accumulative recursion to remove duplicates from a list by keeping a list of unique elements as the accumulator.;Question 2: Write a function that finds the highest number in a vector of numbers. Make use of an accumulator instead of just regular structural or generative recursion.;Question 3: Challenge Problem A bitstring is a list of 0's and 1's: Example: (list 1001101001111) Write a function that takes in a bitstring and returns the length of the longest consecutive string of 0s or 1s. For example, the longest string of consecutive bits in the above list is of length 4.Explanation / Answer
Question: 3
package com.vishalskumar.hackerrank; public class MaxNum { public static int MaxNumNumber(int number) { int count = 0; int max = 0; while (number != 0) { if ((number & 1) == 1) { count++; } else { max = Math.max(count, max); count = 0; } number = number >> 1; } return Math.max(count, max); } }Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.