Sunday 27 April 2014

Sorting programming in java


I am here telling you about Java programming.I am telling here about sorting programming as given below:

Program 1: Bubble Sort
Use your package;
Import Scanner 

class BubbleSort {
  public static void main(String []args) {
    int n, i, j, temp;
    Scanner in = new Scanner(System.in);

    System.out.println("Input number of integers to Bubble sort");
    n = in.nextInt();

    int array[] = new int[n];

    System.out.println("Enter array " + n + " integers");

    for (i = 0; i < n; i++)
      array[i] = in.nextInt();// for array input by user.

    for (i = 0; i < ( n - 1 ); i++) {
      for (j = 0; j < n - i - 1; j++) {
        if (array[j] > array[j+1]) 
        {
          temp       = array[j];
          array[j]   = array[j+1];
          array[j+1] = temp;
        }
      }
    }

    System.out.println("Sorted list of numbers");

    for (i = 0; i < n; i++)
      System.out.println(array[i]);
  }
}

Program 1: Insertion Sort
Use your package;
Import Scanner 

public class MyInsertionSort {

    public static void main(String[] args) {
         
        int[] arr = {9,8,18,5,96,45,2,74 };
        insertionSort(arr);
    }
     
    private static void printNumbers(int[] arr) {
         
        for (int i = 0; i < input.length; i++) {
            System.out.print(arr[i] + ", ");
        }
        System.out.println("\n");
    }

    public static void insertionSort(int array[]) {
        int n = array.length;
        for (int j = 1; j < n; j++) {
            int key = array[j];
            int i = j-1;
            while ( (i > -1) && ( array [i] > key ) ) {
                array [i+1] = array [i];
                i--;
            }
            array[i+1] = key;
            printNumbers(array);
        }
    }
}


Program 3: Selection Sort
Use your package;
Import Scanner 

Selection:
public class SelectionSort {

    public static int[] SSelectionSort(int[] arr){
         
        for (int i = 0; i < arr.length - 1; i++)
        {
            int index = i;
            for (int j = i + 1; j < arr.length; j++)
                if (arr[j] < arr[index])
                    index = j;
      
            int temp = arr[index]; 
            arr[index] = arr[i];
            arr[i] = temp;
        }
        return arr;
    }
     
    public static void main(String a[]){
         
        int[] arr1 = {12,5,98,48,78,96,6,2};
        int[] arr2 = SSelectionSort(arr1);
        for(int i:arr2){
            System.out.print(i);
            System.out.print(", ");
        }
    }
}



Program 4: Quick Sort
Use your package;
Import Scanner 

public class QuickSort {
     
    private int array[];
    private int length;

    public void sort(int[] inputArr) {
         
        if (inputArr == null || inputArr.length == 0) {
            return;
        }
        this.array = inputArr;
        length = inputArr.length;
        quickSort(0, length - 1);
    }

    private void quickSort(int lowerIndex, int higherIndex) {
         
        int i = lowerIndex;
        int j = higherIndex;
        int pivot = array[lowerIndex+(higherIndex-lowerIndex)/2];
       
        while (i <= j) {
           
            while (array[i] < pivot) {
                i++;
            }
            while (array[j] > pivot) {
                j--;
            }
            if (i <= j) {
                exchangeNumbers(i, j);
                //move index to next position on both sides
                i++;
                j--;
            }
        }
        if (lowerIndex < j)
            quickSort(lowerIndex, j);
        if (i < higherIndex)
            quickSort(i, higherIndex);
    }

    private void exchangeNumbers(int i, int j) {
        int temp = array[i];
        array[i] = array[j];
        array[j] = temp;
    }
     
    public static void main(String a[]){
         
       QuickSort sorter = new QuickSort();
        int[] input = {87,74,47,85,76,5,15,2};
        sorter.sort(input);
        for(int i:input){
            System.out.print(i);
            System.out.print(" ");
        }
    }

}



Program 4: Merg Sort
Use your package;
Import Scanner 

public class MergeSort {
     
    private int[] array;
    private int[] tempArr;
    private int length;

    public static void main(String a[]){
         
        int[] inputArr = {3,9,8,2,4,7,78,62};
        MergeSort mm = new MergeSort();
        mm.sort(inputArr);
        for(int i:inputArr){
            System.out.print(i);
            System.out.print(" ");
        }
    }
     
    public void sort(int inputArr[]) {
        this.array = inputArr;
        this.length = inputArr.length;
        this.tempArr = new int[length];
        doMergeSort(0, length - 1);
    }

    private void doMergeSort(int lowerIndex, int higherIndex) {
         
        if (lowerIndex < higherIndex) {
            int middle = lowerIndex + (higherIndex - lowerIndex) / 2;
            
            doMergeSort(lowerIndex, middle);
        
            doMergeSort(middle + 1, higherIndex);
            
            mergeParts(lowerIndex, middle, higherIndex);
        }
    }

    private void mergeParts(int lowerIndex, int middle, int higherIndex) {

        for (int i = lowerIndex; i <= higherIndex; i++) {
            tempArr[i] = array[i];
        }
        int i = lowerIndex;
        int j = middle + 1;
        int k = lowerIndex;
        while (i <= middle && j <= higherIndex) {
            if (tempArr[i] <= tempArr[j]) {
                array[k] = tempArr[i];
                i++;
            } else {
                array[k] = tempArr[j];
                j++;
            }
            k++;
        }
        while (i <= middle) {
            array[k] = tempArr[i];
            k++;
            i++;
        }

    }
}

Wednesday 23 April 2014

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: Calling card the necessity

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: Calling card the necessity: Traditionally, the communication used to occur by the letters. People used to visit the government post offices to buy the foreign inland ...

Calling card the necessity

Traditionally, the communication used to occur by the letters. People used to visit the government post offices to buy the foreign inland letters. The letters used to reach the destinations within a fortnight and sometime within a month. Such response used to be considered as the quickest form of transmitting messages from one end to another. The long waiting and the emotional disturbances have destroyed several lives at the time. Parents used to object any oversea opportunities which the new generation like to avail. Similarly, the young generation also used to refuse the opportunities due to fear of making their parents alone due to long waited communications. But today, the calling cards have completely changed the system.

Always in contact


The communication to the foreign country is now a cake walk. Anybody can call and stay connected for longer and longest period of time. The calling cards, VoIP and internet messaging have enabled users call at distance location without thinking about the geographical distance and differences. Forget parents and the child relationships which used to afraid of the distances. Today, business enterprises are using the technologies mentioned above to keep their business and clients stay in touch on the real-time basis. The globalization has occurred just due to the stability and the solution that calling cards and other provided in the world of business. Now, considering the relationships, parents and families and friends are now happy as they can video chat with the close ones who are far ones now.

Vision


The calling cards are not the just solution provided to the world of communication. The communication is going to the widespread fast and beyond the technological era. For example, people using call India for staying in touch with the people, will avail much enhanced solution in the future at cheaper price. The companies' expansions and the new users availability is going to bring astonishing solution in the arena of long distance calls. Forget the past, the present and the future of the technology is getting enhanced and much futuristic for the users and growing markets.

Wednesday 16 April 2014

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: Tourists Can Call

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: Tourists Can Call: The best services provided by the companies enable them to make calls unlimited and stay in touch unlimited. The customer care department ...

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: Calling to the country (India)

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: Calling to the country (India): The providers moreover due to the tight competition have happened to help the users in much sophisticated way to avoid any issues during t...

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: VoIP to India

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: VoIP to India: Though many believe that companies analysed that the branding depends completely upon the customer satisfaction (which is relevantly true)...

Tourists Can Call

The best services provided by the companies enable them to make calls unlimited and stay in touch unlimited. The customer care department of such companies resolves all queries and the issues that are raised by the customers. They make sure that issue is resolved to the satisfaction to the users. Moreover, the cut-throat competition has enabled the companies to come up with better solutions and option to help people across the various nations such as India, Canada, Australia, Middle East, USA and UK. Further, the technology expansion of the VoIP is helping the business enterprises to go beyond the competition and help the users to gain better solution at a go.



There are several benefits that can be availed by purchasing the calling cards for the country.

The advantages are listed below:

  1. ·         Unlimited calls
  2. ·         Unlimited SMS
  3. ·         Voice enabled messages
  4. ·         Data locators
  5. ·         Store locators
  6. ·         Cheap call rates
  7. ·         Lengthy call features
  8. ·         Easy to subscribe
  9. ·         Reasonable billing
  10. ·         Covering long distances
  11. ·         Satellite connections
  12. ·         Various service providers


These are the just the list of a few services and advantages known in the business world. Tourists just need to buy one of the calling card to explore its unlimited advantages and user-friendly features loaded on the services. This helps tourists stay connect to the close ones when they are on safari to the national parks, palaces, or in the dinner table enjoying their best moments.


But, many times, due to the ignorance factor working with many tourists make them miss the great opportunity to visit India. What is the ignorance factor that work with the tourists that make them prohibit visit the country? The answer is the call India? They get confused and unable to focus how they will remain in touch with their people when they visit to the country. Well! The answer is buying a calling card or enabling the VoIP technology will help them stay connected all the time to their closed ones when they are enjoying their moments. 

Calling to the country (India)

The providers moreover due to the tight competition have happened to help the users in much sophisticated way to avoid any issues during the calls. They make sure the calls are terminated and landed to the right places where the users are looking for. This is the greatest advantages that have helped the users avail better solutions and the lowest rate concerning to the calls. Therefore, when people wish to call to their people and relatives, they can make calls to anywhere in India, Australia, Canada, the Middle East, USA and in the UK.  

Such facilities have helped most of the youngsters a lot. They have received high advantages especially when they are away from their parents. They have been facilitated due the extensive solution that the calling cards or the VoIP technology has provided to the people. Today, the subscribers are in dilemma which services are better for them. They often get confused due to the services provided to the general users. The services impressively astonishing and offers great solutions to the people and business enterprises. 


They often get the advantages of the various options that are provided in the market. To Google the right keyword in the approach has been the technology provided to the users by the companies. So, get one of the best calling cards today.


Calling cards, VoIP and the internet instant messaging has enabled user call their relatives at a go. The features provided to phone India are easy and affordable. The cutthroat competition has enabled companies to come up with extra ordinary solutions that people never have imagined. The unlimited factors in calls and messages have encouraged people forget about the geographical distances at all. No, pin number exchange and the easy to install in the smart phones features have made the calls easy and flexible. Now, the subscribers can call to their closed people at a go without switching on or carrying the two gadgets, one for local and another for international calls.

VoIP to India

Though many believe that companies analysed that the branding depends completely upon the customer satisfaction (which is relevantly true) and this theory encouraged them to come up with the solution to establish call centres for the customer. Secondly, the low currency rate of the under developing companies also helped the companies to establish the call center.

But, the main supportive factor that worked behind was Voice over Internet Protocol. The VoIP technology helped the companies dial unlimited numbers beyond the international boundaries. You may be surprised by the answer; however, this is the true story behind it.


The technology offer many benefits to the users. These are listed below:

1.       The technology has been developed on the internet platform. This helps the users (business enterprises or daily users) to transmit their voice as well as data across the networks. This enables them to call or send SMS to the people staying at distant places.

2.       VoIP is not boundary restricted. You can make calls and send SMS across the time zones. You can get connected to the people using any internet savoy devices. There is no restriction or extra charge that the users have to pay due to long distant communication.

3.       The technology is completely dependent upon the internet. Therefore, the data (voice and text) is easily sent and receive over the network through the internet servers. Thus, the communication enabled never has to witness any downtime or other issue related to the technology.

4.       After the technology become successful and known to the people, there came many providers that offered better packaged to the businesses as well as to the users. They came with their own customer care to help users round the clock and enable them to resolve entire issues without making any of the customers annoyed.  


5.       Lastly, we can focus on the accessibility that the technology has provided to the customers. Customers can now call across the various nations such as Australia, Canada, the USA, UK, Middle East and also in India. In fact, VoIP to India has been analysed by several business leaders in the recent years. 

Monday 7 April 2014

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: call to India

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: call to India: Indian telecom companies have fared better than others owing to its innovative business models and offerings. It must be noted that In...

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: call to India by Phone

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: call to India by Phone: To phone India you can also use the Voice over Internet Protocol (VoIP) in order to cut-off the calling charges to that of domestic c...

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: Send SMS or India calling

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: Send SMS or India calling: After Cable and communication satellites, fiber optics and Voice over Internet Protocol (VoIP) have turned the things around, especial...

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: send text or sms to family

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: send text or sms to family: Many companies rely heavily on short service message or multimedia messaging service to promote their products and pitch for new prosp...

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: send text or call India

Call India, Cheapest Call to India and Send Text Message to India form Anywhere: send text or call India: Most of the apps are free of cost and offer free service. Some applications which are touted as the premium option generally fail to i...