Linear Congruential Generator

Linear congruential generator is very basic algorithm to generate random numbers. Although it is a very fast algorithm, it may not generate very random variables. The formula of that generator is giv ...
Mert Deniz Güngör
Published on Mar 20th, 2018

Luhn Algorithm

Luhn is a simple checksum formula used to validate a variety of identification numbers, such as credit card numbers. Below is how this algorithm works: From the rightmost digit, which is the check d ...
Mert Deniz Güngör
Published on Mar 20th, 2018

Reverse Polish Notation Calculator

Calculate the value of a given expression in Reverse Polish Notation. Definitions: {expr} = [ {expr} {expr} {operator} | {integer} ] operand = {integer} operator = [+, -, /, *] valof(expr) := intv ...
Ali Ahmet Bingül
Published on Feb 26th, 2018

Square Root

Given a non-negative number num find the square root of the number. If the square root is not a integer return the whole part. (Ex sqrt(10) = 3) Try to do it without using system libraries. Please ...
Ali Ahmet Bingül
Published on Feb 26th, 2018

Find the unique element

You are given an array of non-negative integers where each element occurs exactly twice except one which occurs once. Find the element occurring once. Examples: Input 1: [1, 1, 2, 2, 3] Output 1 ...
Ali Ahmet Bingül
Published on Feb 13th, 2018

Sum of square of first n odd numbers

Problem Given a number n, find the sum of the square of first n odd natural numbers. Example Input : 3 Output : 35 1^2 + 3^2 + 5^2 = 35
Erkan Ercan
Published on Feb 11th, 2018

Bookshelf Organizing

You have an enormous book collection and want to buy some shelves. You go to a store and they sell all kinds of shelves. The weird part is, some shelves are different in length but they all cost the ...
Erkan Ercan
Published on Feb 6th, 2018

Poisoned Plants

There are n plants in a garden. Each of these plants has been added with some amount of pesticide. After each day, if any plant has more pesticide than the plant on its left, being weaker than the le ...
Coder
Published on Feb 2nd, 2018

Program to compare two strings

Write an algorithm to compare two strings. Check if they are equal or not. If equal return True. Else False. Example If string1 is "codela" and string2 is "cdl" output return must be False.
Erkan Ercan
Published on Jan 29th, 2018

Program to delete vowels from a string

Write an algorithm to delete vowels from a string. Given a string. You need to delete vowels of this string and return string. Example If string is "codela", return must be "cdl".
Erkan Ercan
Published on Jan 29th, 2018