Skip to content

Tag: algorithm

Random search on an array of size N

I need help fixing my code below. I want to do a random search on an array of size N. Random search randomly picks up an integer from arr to compare. And the process repeats until the integer it is looking for is found (again it is remarked that the membership is guaranteed, otherwise random search obviously …

Down to Zero II

This is the question: You are given Q queries. Each query consists of a single number N . You can perform any of the operations on in each move: If we take 2 integers a and b where N=a*b (a ,b cannot be equal to 1), then we can change N=max(a,b) Decrease the value of N by 1 . Determine

JAVA // How do i make it case-insensitive?

I used the translator. It’s a university algorithm assignment, Merge sort implemented successfully. Now, capital letters come out first, and lowercase letters come out. Can make the code case-insensitive? I want the results to be like this. ex) a A A B b C c c D d … plz help. Answer Instead of com…