Starting from:

$30

CECS328-Assignment 2 Implementing Square Root Function Solved

Question 1. Implementing the square root function: Write a function that asks a user to enter an integer N



and returns ⌈√𝑁⌉. 

(Note: You are NOT allowed to use the predefined sqrt function in the programming language you are using)

Question 2. Ask the user to enter a random binary array having the first K numbers equal to 0 and the rest equal to 1. Write a function to find the position of K that splits the 0s and 1s.  (Example: input: a = [ 0 0 0 1 1] ➔ output: K = 3)

More products