Bubble sort

There are different sorting algorithms are available like selection sort, insertion sort etc. In this article we learn about one of them sorting algorithm, working of this sorting algorithm and example of this sorting algorithm. Bubble sort algorithm is the simplest sorting algorithm as compare to other sorting algorithms. In the bubble sorting algorithm, array is traversed from first element to last element. In this sorting, compare the...

Binary search

Binary search is one of the fundamental algorithms in computer science. In order to explore it, we’ll first build up a theoretical backbone, then use that to implement the algorithm properly and avoid those nasty off-by-one errors everyone’s been talking about. Finding a value in a sorted sequence In its simplest form, binary search isused to quickly find a value in a sorted sequence (consider a sequence anordinary...

Binary Search Program

There are two types of searching are possible. First is linear search and second is binary search. In this article we explain about the binary search program, if you want to learn about what is linear search and how it works? see this article Linear Search. The linear search and binary search are used to find the key element in a given multiple elements and displays the position...

Declare, Instantiate and Initialize the Arrays

In this article we learn how to declare instantiate and initialize the array. Arrays are nicely organized lists of data. Think of a numbered list that starts at zero and extends one line every time you add something to the list. Arrays are useful for any number of situations because they’re treated as a single hunk of data. Here we will see how to declare array and how...

Arrays

Arrays are nicely organized lists of data. Array is a collection of the homogeneous data types. Think of a numbered list that starts at zero and extends one line every time you add something to the list. The arrays are useful for any number of situations because they’re treated as a single hunk of data. The array is one of the most important part in a any of...

Swapping of Two Numbers

Here we will see the swapping of two numbers using two different methods. In first method we exchange the values using the temporary variables and in second method Swapping of numbers without temporary variable. Swapping of numbers is the way of exchanging the values in the variables. Suppose there are two variables a and b, The variable a has a value 15 and the variable b has the...

Addition of Two Numbers

In this program we will see the addition of two numbers using two different methods. In first program we specify the values of two numbers in the program itself. And in second program take the both numbers entered by user and add. In third program we use add () function. Adding the numbers using java programming is same logic as add the numbers using other programming languages. Adding...

How To Run a Java Program

If you are new in java programming and you want to know how to run a java program then see the below steps. For running the java program use the Notepad and Command Prompt. Simple Java Program: In order to start with basic Java programming, let us look at the standard Hello World program. In this programs we will simply print the "Say Hello World To The World!"...

Back to Top