Showing posts from 2012

Queue data structure using Array in Java

A queue is a linear list of elements in which deletions can take place only at one end, called the front of the stack, and inser… Read More>>

Generic Type in Java

The term generics here means parameterized types. Parameterized types are important because they enable you to create classes… Read More>>

Convert infix to postfix using stack in Java

Infix Expression : Any expression in the standard form like "2*3-4/5" is an Infix(Inorder) expression. Postfi… Read More>>

Convert Decimal to octal using stack in java

You all are aware of Stacks. It performs two basic operations push and pop. The push operation adds an element to the top of the… Read More>>

Convert Decimal to Hexadecimal using stack in java

You all are aware of Stacks. It performs two basic operations push and pop. The push operation adds an element to the top of… Read More>>

From National Identity Card(NIC) print date of birth in java

The following numbering system is followed in order to assign this number: Digits 1 and 2: The year of birth Digits 3-5… Read More>>

Read values from a file and Sort the numbers using merge sort and quick sort algorithm in Java

Merge sort algorithm 1. The length of the list is 0 or 1, and then it is considered as sorted. 2. Otherwise, divide the u… Read More>>

FileReader -Java Read File Line by Line in Java

The FileReader class makes it possible to read the contents of a file as a stream of characters. It works much like the FileIn… Read More>>

An Array of Linear list in java

Linked lists are among the simplest and most common data structures. They can be used to implement several other common abstr… Read More>>

Operation and interface on linear list in java

Operations : isEmpty() - Returns true if the List is empty ,false other wise. size() - Give the number of element in the lis… Read More>>

The n-queens problem in Java

A classic combinatorial problem is to place n queens on an n × n chess board so that no queen threatens any other queen, that… Read More>>

Knapsack Problem in Java

Knapsack problem : The knapsack problem or rucksack problem is a problem in combinatorial optimization: Given a set of i… Read More>>

Maximum and Minimum using Divide and Conquer in Java

Divide-and-Conquer Min-Max As we are dealing with sub problems, we state each sub problem as computing minimum and maximum of … Read More>>

Recursive Binary Search in java

Algorithm :  Algorithm is quite simple. It can be done either recursively or iteratively:   get the middle element;  if th… Read More>>

QuickSort in java using divide and conquer algorithm

Algorithm : Quicksort is a  divide and conquer algorithm . Quicksort fi… Read More>>

Calculate age in java

Here, you can calculate the age of a person easily through the given program. This program takes your complete date of birth … Read More>>

Convert decimal to binary using Stacks in Java

How to convert decimal into binary using stacks. You all are aware of Stacks . It performs two basic operations push and pop… Read More>>

Mergesort in Java using divide and conquer

Merge sort is a divide and conquer algorithm. The sorting elements are stored in a collection. This collection is divided i… Read More>>

Binary search in array in java using divide and conquer

Let LIST be a list of elements that are sorted in non-decreasing order. Consider the problem of determining whether a given e… Read More>>

Stack Data Structure in Java

Stack data structure : A stack is a limited version of an array.  New elements or nodes as they are often Called, can be ad… Read More>>

Load More Posts That is All