String Similarity

For two strings A and B, we define the similarity of the strings to be the length of the longest prefix common to both strings. For example, the similarity of strings “abc” and “abd” is 2, while the similarity of strings “aaa” and “aaab” is 3. Calculate the sum of similarities of a string S […]

Continue Reading

Fibonacci

Complete the function fibonacci to return an array containing the first N Fibonacci numbers. fib(n) = n                                , n <= 1 fib(n) = fib(n-2) + fib(n-1), otherwise Constraints: 1 ≤ N ≤ 10   Sample Input 4 Sample Output 0 […]

Continue Reading

Calculate Factorial

Write a program that will read an integer N from STDIN and compute the factorial of N. The input to your program will contain many lines. On each line there will be exactly one integer. Your program should print the factorial of each integer in a separate line. Your program should terminate when it reads a number […]

Continue Reading

Maximum Difference in an Array

Return the maximum difference between any a[i] and a[j] where a[i] < a[j] and i < j The maximum difference for a pair of elements in some array a is defined as the largest difference between any a[i] and a[j] where i < j and a[i] < a[j]. The declaration for a function named maxDifference […]

Continue Reading

Types of software Testing

Software Testing Types: Black box testing – Internal system design is not considered in this type of testing. Tests are based on requirements and functionality. White box testing – This testing is based on knowledge of the internal logic of an application’s code. Also known as Glass box Testing. Internal software and code working should […]

Continue Reading

Install Cassandra and Titan on Ubuntu Server 14.04 Trusty

titan logo

Hello everyone, this guide show step by step how to install cassandra and titan on Ubuntu Server 14.04 Trusty. In my example, My Ubuntu Server username: tiendang My IP: 192.168.14.129 Prerequisites Install Ubuntu Server 14.04 Trusty. Link download: http://releases.ubuntu.com/14.04.1/ubuntu-14.04.1-server-amd64.iso After install, make sure your server is up to date sudo apt-get update sudo apt-get upgrade  Check your […]

Continue Reading