Tagged: Beginner


Find three elements in an array that sum to a zero.

Objec­tive:  Given an array of integers write an algorithm to find 3 elements that sum to a zero. In short a+b+c = 0. Example int [] = { 3,-1,-7,-4,-5,9,10}; Elements are -4 9 -5 Approach:...


Check if array is sorted using recursion

Objec­tive:  Given an array of integer write a recursive solution to check if array is sorted. Example: int [] a = {1,2,3,4}; Output: true int [] a = {1,2,3,4,2}; Output: false Approach: This problem can...


Find remainder without using modulo operator

Objec­tive:  Write Given two integers ‘number’ and ‘divisor’, Write an algorithm to find the remainder if ‘number’ is divided by ‘divisor’. Condition: You are not allowed to use modulo or % operator. Example: num =...

%d bloggers like this: