I ran into special case where I need to produce ultra symmetrical line or ray in 2D grid in order from (x0, y0) through (x1, y1) like this:
void drawSymmetricalLine(int x0, int ...

Generally speaking, can you suggest an approach which would let me test objects to make sure they are alike.
Accept that objects are alike if over 'n%' worth of content of ... 
I am interested in this algorithm: http://stackoverflow.com/questions/115426/algorithmtodetectintersectionoftworectangles
but unable to implement it myself lacking even basic mathematical skills. I think I could understand it better once I can read the code. ... 
I am new to Java and even OOP, but I tried to write program for this task:
A Pythagorean triplet is a set of three natural numbers, a < b < c, ...

I seem to be either losing my mind or misimplementing the A* algorithm:
Below is my code, it seems that no matter what values I enter it will always return ... 
I have a range in java implemented as a class which is divided into subranges. The implementation is roughly as follows:
public class Range
{
static public class Key implements Comparable<Key>
...

I started to delve into GA a bit here for study and I cannot seem to find an answer to crossover generation break points. For instance if I start with ... 

Currently, my algorithm is someValue + x . I am trying to figure out how I can transform x to 1 if its greater than 0, or to 0 if its equal ... 
I'm trying to write a DFS to solve multiple river crossing problems (Fox Goat Cabbage, Jealous Husbands, Mercenaries and Cannibals, etc.). I've written the puzzle classes, but I'm having trouble structuring ... 
I had this coding question in an interview.I couldnt find an optimum solution to this.
what I did was,
for(i=0;i<n;i++)
for(j=i;j<n;j++)
if(a[i]+a[j]==k) print a[i], a[j]
But that would give rise to a O(n ^{2}) complexity.
Is there a ... 
What is an example (in code) of a O(n!) function? It should take appropriate number of operations to run in reference to n; that is, I'm asking about time complexity.
... 
I'm programming in Java. Every 100 ms my program gets a new number.
It has a cache with contains the history of the last n = 180 numbers.
When I get a new ... 
I found some Java code for generating combinations on, but I can't understand what it is doing as it does some strange operations with bits.
import java.util.Collections;
import java.util.LinkedList;
public class Comb{
...

public class Main {
public static void main(String args []){
long numberOfPrimes = 0; //Initialises variable numberOfPrimes to 0 ...

I have a twodimensional array of ints, for example:
int [][] board=
{
{23,17,3,29,12,10},
{17,4,11,12,10,19},
{32,33,25,25,28,35},
{27,29,24,25,23,37},
{29,40,34,26,24,39},
{23,37,29,36,31,3}
}
I don't want to change the columns of this array at all; however, I would like to swap the rows so ... 
I'm making a bitmap editor where a document consists of several layers where each layer represents a bitmap. Each layer must have a unique ID compared to all other layers that ... 
Am suppose to return the number of character comparisons. In the while() loop i compare the index of the characters and update the counter. My question is, is it right to ... 
I read at many places, but did not find a place where I can learn about :
What is java garbage collection all about?
How is it implemented?
When and ... 
___________1
__________1 2 1
_________1 2 3 2 1
________1 2 3 4 3 2 1
______1 2 3 4 5 4 3 2 1
_____1 2 3 4 4 4 4 4 3 2 1
___1 ...

Wikipedia says that:
Nonblocking algorithm ensures that
threads competing for a shared
resource do not have their execution
indefinitely postponed by mutual
exclusion.
How can one ensure ... 
Here I have my DCT algorithm class with "applyDCT" and "applyIDCT" methods. Technically after doing a forward DCT (discrete cosine transform) on a 2x2 table of random integers between 0 and ... 
I have creating the blindSearch method so as to write the convexHull Algorithm. but it doesnt work right, and doesnt remove the internal points. would you please help me?
public Point pnt[] ...

I am trying to implement a coin problem, Problem specification is like this
Create a function to count all possible combination of coins which can be used for given amount.
All possible combinations ...

Can someone please share a program in java which does the following.
if given the following sets as inputs,
a={1,2,3,8,9,10}
b={1,2,3,4,5}
c={4,5,7}
d={5,6,7}
e={6,7,8,9,10}
and
U={1,2,3,4,5,6,7,8,9,10}
the program will find all the combinations of the set and find out the ... 
I'm trying to output multiple lists of data, of varying length, to a CSV file. Each list should be a column in the output CSV file. Is there a straightforward way ... 
Can someone pleas share with me a java program that uses the Branch and bound method to solve the Set Cover problem?
Following is what I have so far. So at ... 
I am writing a program that deals with cards and a hand. A hand has 5 cards. I want to know whats a good algorithm for deciding which combination of cards ... 
I was performing some test performance on an algorithm and noticed something weird. Maybe I am missing something here.
I first measure the time in milliseconde:
long startTime = System.currentTimeMillis();
x.sort(sortStringInput);
long endTime = System.currentTimeMillis();
and ... 
I am doing designing an algorithm for an assignment, and I am not sure that I have written a correct algorithm, would you please guide me? The question is:
There are n ... 
Are there libraries out there that can convert data (text files, etc) to sound and back to the original data?
The sound can be transmitted any medium I wish, whether radio, etc. ... 
I am a server side Java programmer. In my recent job search, I have come across a few postings where they mention : ' Candidates with expereince in algorithm development will ... 
I have Google'd my butt off, and I can't find anything on this topic.
I am trying to create a download client using Java, and I have figured out how to download ... 
I'm currently doing a project that requires some fast TSP solving (about 50100 nodes in 2 seconds). There are a lots of approximation algorithms out there, but I don't have time ... 
Using Bloom filter , we will be getting space optimization.But in reality, how it is achieved.
The cassandra framework is such kind of frame work,if I am correct.

I'm currently using the A* pathfinding algorithm to calculate a path on an infinite grid (using an UnboundedGrid in Gridworld, the AP CS case study, if that helps anyone). Everything works ... 
I'm not yet a skilled programmer but I thought this was an interesting problem and I thought I'd give it a go.
Triangle, pentagonal, and hexagonal
numbers are generated ... 
Disclaimer: I have little background in Java, since I am predominantly a C# developer.
Would like to have the java implementation of A* algorithm.
Yes, I saw many versions of the same online ... 
Possible Duplicate:
Best book to pick up algorithms and data structures?
I am a fairly new Java developer. I understand most of the syntax ... 
I wonder if there is a useful Java implementation of a Branch And Bound algorithm for the TSP or in general a OR framework which includes a BnB for TSP.
Thanks for ... 
Possible Duplicate:
Branch And Bound Implementation for TSP in Java
Hey folks,
I wonder if there is a useful Java implementation of a Branch And Bound algorithm ... 
For some code I'm writing I could use a nice general implementation of debounce in Java.
public interface Callback {
public void call(Object arg);
}
class Debouncer implements Callback {
...

so, this is a couple days off when I run the program. any advice?
and yes, i know there is a simpler way to do it, but for this i'm trying to ... 
I am trying to implement a solution for calculating the conversion between RGB and CMYK and vice versa. Here is what I have so far:
public static int[] rgbToCmyk(int red, ...

I have this programming project i have to develop an algorithm for location based data grabbing and displaying it on the mobile. i'm just a regular web programmer knowing some php ... 
I'm creating an organism simulator for Android, so I guess the algorithm would ideally be in Java. I realize that there is a whole Stanford course on Machine Learning available on ... 
Do you know any implementation, (java) to solve non linear programming with this algorithm? Could you explain that algorithm, or the code?

I need to do OCR in java for final year prject. i have tried many APIS but dint work for me ...any one who can help or can provide code or ... 
I'm looking for the algorithm (bitmap pixel manipulation) to simulate the fisheye lens (Barrel Distortion) from normal pictures. So far I've found implementation involving external libraries like OpenCV, OpenGL or jhlabs. ... 
I need help, I am trying to make use of Lattice Multiplication in java for use in a BigInt class I am having to write for a class.
Right now I ... 
I'm using Lucene to get frequency of terms in documents, i.e. number of occurrences of some term in each document. I use IndexReader.termDocs() for this purpose, and it works ... 
I have a very weird problem which has some constrains that make it difficult to solve. I have a list of lists and I want to do the combinations of all ... 
Possible Duplicate:
Any tutorial or code for Tf Idf in java
can anyone provide me an insight on how to calculate TFIDF in java ?
i ... 
I know the algorithms of MRU and its reversed one Least Recently Used (LRU).
I think LRU is reasonable, as LRU element means it will be used at least possible in future. ... 
for a part of my revenue program I am making as an assignment for school I have to calculate a number which is the Total Tax Owed from a citizen. I ... 
I"m getting an error java.lang.NullPointerException error on the following code.
The algorithm:
 If n ? 3 find the closest points by brute force and stop.
 Find a vertical line V such that divides the ...

I've implemented the following Prim's Algorithm method.
It returns the MST weight. However it seems not to be working for some cases.
Can anyone please tell me what I'm doing wrong?
private static int ...

We have to monitor the change on a remote system file, that we acces throught FTP, SMB.
We do not have any SSH access to the remote system / os. Our only ... 
Let's say I use arrays to plot out my game map using this:
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, ...

Help me please with Boruvka algorithm for creating a minnimumspanning tree. I wrote code of an algorithm looking on example given by Sedgwick but apparently had done a bunch of nonsense, ... 
I have successfully implemented a shunting yard algorithm in java. The algorithm itself was simple however I am having trouble with the tokenizer. Currently the algorithm works with everything I want ... 
I am aware that by default Java does not have the socalled eval (what I pronounce as "evil") method. This sounds like a bad thing—knowing you do not have something ... 
Possible Duplicate:
Implementing SIFT in Java
Hi
I need to compare an image with images in database using sift algorithm
Can anyone tell where I can get java ... 
Do you know any template for the simulated annealing in java?

I'm trying to use the Simple hill climbing algorithm to solve the travelling salesman problem. I want to create a Java program to do this. I know it's not the best ... 
I've been trying to implement a minMax Algorithm (will try alphabeta pruning later) for a simple game....I've seen many pseudo codes and tutorials but i just can't get it to work...
A ... 
I feel like there should be an available library to more simply do two things, A) Find the mode to an array, in the case of doubles and B) gracefully degrade ... 
For my application I need to calculate an angle between two different lines:
1) The first line is between a point on the earth which is defined by longitude and latitude and ... 
Anyone know of a way to handle ZIP files produced using the SHRINK algorithm? This doesn't appear to be supported by the standard Java ZIP functionality.
We're receiving ZIP files from ... 
Please note: While the bounty is no longer available, I'm still keen for anyone with a good answer to this question to contribute; I'm still watching it, and will award upvotes ... 
I implemented the Edmonds–Karp algorithm using the Pseudocode that I found in the Edmonds–Karp algorithm wiki page: http://en.wikipedia.org/wiki/Edmonds%E2%80%93Karp_algorithm
It works great, yet the algorithm output is the max flow value(min ... 

 1  1  3  5  1 

 3  3  2  0  3 

 3  0  3  2  3 

 ...

I am working on a project where I have to extract the human sound from a audio .wav file using java.
The audio .wav file may have 3 to 4 sounds ... 
Hey I'm trying to implement reservation system for parking lots registered at my website. I have a hardware that detects the presence and absence of car at a parking space. So ... 
I am currently working on a project (TSP) and am attempting to convert some simulated annealing pseudocode into Java. I have been successful in the past at converting pseudocode into ... 
I'm looking for an algorithm using java that similar to Paul's prediction. It looks like if we give two numbers to the algorithm, it will give one number randomly from those ... 
I'm writing a a multiplechoice quiz program for Android, and would like to add a randomization feature to it, that is, the questions will come from a list, and the order ... 
I have a mathematical formula in my program that takes in two values, both between 0 and 1, and does a lot of work to find an answer.
I also want ... 
I am trying to create a gag calendar app and need some help getting the algorithm correct to create a calendar like this:
Sunday
Jan Feb .. Dec
2 6 ...

I've been told that
O(2^N) denotes an algorithm whose growth will double with each additional element in the input data set
Can someone provide an example that behaves like this?

Hey guys I am trying to implement a method for solving singly even magic square, but it seems to generating the wrong results.
Result generated by the following code
Enter in size ... 
I built a hexagonal table, each hexagonal I put on a label ... Now I noticed that there is overlap between the hexagons because the shape of the label is ... 
I want to learn the backtracking algorithm. Can someone please teach me some of it? I tried learning from some websites, but it didn't work. So can someone please teach me. ... 
Set an algorithm that reads a undetermined number of values to m, all positive ints, one at a time. If m is even, verify how many divisors there is and write ... 
i came across this question on this website called codility, but i cant really figure out how to solve it, would appreciate the help
Given an array A of n integers, and ... 
so i took the codility interview test yesterday and was informed today that i failed, unfortunately i wasnt given any other information by either codility nor the employer as to where ... 
Possible Duplicate:
Improving performance of preprocessing large set of documents
Hi,
I have a document set contain about 100 documents. I have to preprocess each of these ... 
Java Source Code:
package n1_problem;
/**
*
* @author nAwS
*/
public class loop {
int loop(long i)
{
long n=i;
...

import java.util.Scanner;
public class doisExercicio {
public static void main(String[] args) {
int n, fat=1,c=1, aux;
Scanner leia=new Scanner(System.in);
System.out.println("Digite um numero inteiro");
n=leia.nextInt();
aux=n;
do{
fat*=aux;
...

I have a CSV file of the following format:
session_id,time,item
where the possible amount of items is huge.
Which framework/library fits best for that problem (Generalized Sequential Pattern Discovery)?

You have an input a n games.
Each game has a fame (which can be negative) and prerequisite games (these games must be played before you play the current game).
You want to ... 
Your second challenge is to implement bots that can find the shortest path to an exit. In the maze
shown in figure 1 A20% ? E10% ? D0% is not an acceptable ... 
I'm solving this BFS homework problem, I believe the logic I'm following is right, but I got stuck in an implementation error I can't pinpoint. I'm looking for help debugging this ... 
I remember my 2D collision detection algorithm to be more scalable... However, I feel that I may have sacrificed performance. In order for this scalability to work I had to this:
 Created ...

I'm struggling to get the below problem working with no approach in right direction.
Write a java function such that given an array of ints, is it possible to choose a group ... 
how can we build a directed graph representing the adjacency structure of the words, and run BFS on it.
the program should take two file names as arguments. The first ... 
Possible Duplicate:
Java : Summation of multiples of 5 in a group to a given target
Hi SO People,
I'm struggling to get the below problem working ... 
I have an ArrayList that has Double elements. I want to implement FFT (Fast Fourier Transform) on it. However I don't want to take a Java code somewhere else and copy it. ... 
There are:
A set of points in a plane, Counts of points can be big (1 Bilion). I need to find algorithm to find all square that can be created ... 
I just found this algorithm to compute the greatest common divisor in my lecture notes:
public static int gcd( int a, int b ) {
while (b != 0) ...

I want to find a library or an algorithm (so I write the code myself) for identifying the nearest k neighbours of a webpage, where the webpage is defined as being ... 