# Author: dharam

## TechieMe New Android App

Hello there! I have recreated a completely new and better android app for this blog. Have a glimpse of the new UI and features below This app is a companion to the this programming blog  and a possible improved replacement to the older version  This is an ever increasing knowledge repository, with classic and configurable user interface and awesome user experience. The content is cleanly segregated and presented. The app contains posts on topics like: 1) Java/J2EE 2) Algorithms 3) Datastructures The Send a Suggestion feature allows you to request ...

## Find the Point of Rotation in Sorted Array

Problem Statement You are given a sorted array. However, there is a problem. Someone just rotated the sorted array by K spaces and we do not know the value of K. Write a program to find the value of K by which the array is rotated. As the array has millions of numbers, it would be good to have a solution which takes minimal time. Approach to Find the Point of Rotation Brute Force Let us try out my favorite approach, the Brute Force Method. It is quite simple, below are the steps: Start traversing the array from the beginning There will be a index in the array where the value sto...

## Find the maximum possible profit

Problem Statement Given an array of stock prices per share for a given share over a time period. Calculate the maximum possible profit per share one could have made . Here we do not consider short selling as an option. The trader must have purchased the stocks before selling it. The problem statement is a real world definition of the problem called maximum positive difference. For the above two arrays, here are the maximum profit per share one could have made: A : 18.0 (difference between 21 and 3) B : 13.0 (difference between 19 and 6) What is Maximum Positive Difference? ...

## Introduction to Functional Interface – Java8

What is Functional Interface? A functional interface is any interface which contains only one abstract method. A functional interface can have one or more default and static methods. Also, there is an annotation in Java @FunctionalInterface which is used to annotate the functional interfaces. It is not a mandate for functional interfaces to carry this annotation. There are many predefined functional interfaces in Java which belong to the package java.util.function What is the significance of these interfaces? These interfaces as we know declare a method which can be implemented and us...

## Understanding Binary Search Algorithm

Introduction The problem of searching is very trivial. It goes like this: There is an array of elements A[1..N] and we need to find the index of a given element in the array. In case the element is not present in the array, we can choose to return a specific value (say -1) which suggests that the element doesn't exist in the array. Binary Search is a very efficient and interesting searching algorithm. Regular searching algorithms take running time proportional to the size of the input. They are called linear time algorithm O(N) to be asymptotically true. Binary Search on the other ha...