## We are Dreamers

We are the dreamers              We are the dreamers                                       with a dream of flying high,      We try to touch the sky,                                     And go to a boundless world.             We believe in what we are,                                   We do what we can.              Nothing can stop us,                                    because we are the dreamers.               Our dream is to built an INDIA,                                                   which world will know.               We tempted to achieve our goal,                                                    And eager to score it.                Everybody will know us,                                                    because we…

## Send note as E-Mail from PC application using JAVA

Hi guys. This is my first post using my home management system. Here i am going to post codes on making a simple app that can be used to send email with notes to your own mail. this comes handy when you are working on office or other PC and you want to save something interesting, In that scenario hopefully you will not be interested to open your mobile and get on typing. Hope this helps. But to use this you need to enable IMAP and POP in your mail…

## Hackerrank Utopian Tree Solution

This is the solution to the program in Hackerrank. This program can be found in the Algorithm Domain. Basically the Utopian Tree goes through 2 cycles of growth every year. The first growth cycle occurs during the spring, when it doubles in height. The second growth cycle occurs during the summer, when its height increases by 1 meter.  Screenshot The Code: #include<stdio.h>int main() { int t, n, a; scanf(“%d”, &t); while(t–) { a=1; scanf(“%d”, &n); for(int i=1; i<=n; i++) { if(i%2) a<<=1; else a++; } printf(“%dn”, a); } return 0;}…

## Simple Factorial program for larger numbers

It is a totally different approach, we are just playing with double.As we know double has very large value 4.9e-324 to 1.8e+308.Then we convert the double into an integer array. Screenshot: OUTPUT The Code: #include<iostream>#include<stdlib.h>#include<math.h>using namespace std;/*Classic factorial function to find the factorial of a number using recursion method*/double factorial(int n){ if(n==1) return 1; else return (factorial(n-1)*n);}int main(){ int n; cout<<“factorial of: “; cin>>n; double r = factorial(n); double s = r; int i=0; /*to find the number of digits of the answer*/ for(i=0; r>=1; i++) { r /= 10;…

## Bubble Sort In Python

This is a simple program which demonstrates the implementation of the bubble sort algorithm in python. The complexity of the program is O(n2) . The Input is taken from the console and then appended to a list, which is further processed . Output Screen: Program : print ‘Enter the list of elements followed by space:’x=raw_input();x=map(int,x.split())for i in range(0, len(x)-1): for j in range(0,len(x)-i-1): if(x[j]>x[j+1]): swp=x[j] x[j]=x[j+1] x[j+1]=swpprint x Found suggestions, Please comment them here !

## Binary Search using Java

It is a technique to search an element in sorted array. In this type of search half of the array is ignored just after one comparison. Each time required element is compared with middle element of the array and range is decided . Best Case Performance :  O(1)Average Case Performance : O(log n)Worst Case Performance : O(log n)Demo Output: The Program import java.util.Scanner; public class BinarySearch1 { public static void main(String args[]) { int i, first=0, last, mid, no, element; Scanner s = new Scanner(System.in); System.out.println(“n How many elements:”); no=…

## User Defined Exceptions in Java

In this post you will learn to create your own, user defined exceptions. This program will handle unchecked exceptions, i.e those exceptions which cannot be checked by the compiler, or the run time exceptions. In this program there is a simple class AgeMargin in which when the age is less then 18 or greater then 24 generates an AgeException. Screenshots[Demo] The Code: import java.util.Scanner;class AgeException extends Exception{  public String toString()  {    return “AgeException Caught!”;  }}public class AgeMargin {  public static void main(String []args)  {    int age;    Scanner…

## OpenMP, Parallel Programming in C [Intro]

This is a post in which you will get the basic knowledge about the parallel programming concept. In this post we going to use the OpenMP model. This program is implemented in the C Language. Basically this programs demonstrates how the thread gets executed in different Cores of the processor. In this case, this program is executed in a Quad Core CPU, so it displays 4 threads from 0-3. Screenshots[Demo] Here the threads are executed randomly on each cores on the basics of their availability. This method by which threads…