Infix to postfix algorithm

2216 byte By torvald_helmera at 2007-10-2 3:24:54
I need som help to finish my algoritm.This is what I have so far:import java.util.Stack;import javax.swing.*;public class InfixToPostfix {public static void main(String[] args) {Object slutt= "#";char[] operator = {'^','*','/','+','-'};charvParentes = '(';charhParentes = ...

Searching for a string in many documents

413 byte By BigBadBurrowa at 2007-10-2 3:26:52
Hello,I'm trying to implement a search system whereby I can search through documents to find a specific phrase. I was wondering, if anyone had any ideas on what would be the fastest method of doing this?Would it be suffient to use indexOf(String) to dertemine whether the string is present in a ...

PID algorithms

90 byte By whirlwinda at 2007-10-2 3:41:35
Are there classes openly available that perform the PID calculation (if so, where?)

how can an ASCII coded text file covert to alphanumeric characters?

240 byte By java08a at 2007-10-2 3:51:59
how can an ASCII coded data which are in a text file convert in to a alphanumeric characters? when converted, the alphanumeric characters can be read in a java based web site! can you pls give me an example? pls......!!!!!!!!!

Diameter of a binary tree

179 byte By LeonLLa at 2007-10-2 3:54:07
The diameter of a tree is the length of the longest simple path between nodes of a binary tree. How do I use Divide and Conquer to find the diameter using JAVA?Thank

why it doesn't work?

1692 byte By tony_birda at 2007-10-2 3:56:26
That's my program, i want to see whether hashCode() and equals() would be involked when Vector.contains() (or Vector.indexOf()) is used. But it seems that these two fonctions don't be involked by contains(). What's the problem? import java.lang.*;import java.util.*;import classes.*;class ...

PDF Algorithm

193 byte By robinhollensteina at 2007-10-2 3:57:51
What kind of algorithm does Adobe Reader implement to read (and write) PDF files. I must know this because I want to read a PDF file and extract the text. Any ideas?R. Hollenstein

Dijkstra

80 byte By c-darmaa at 2007-10-2 4:04:34
Where i can find the code of this algorithm in java?thank's a lot

convert decimal degrees to degrees minutes seconds

99 byte By jmgreen7a at 2007-10-2 4:06:21
I have seen the actual algorithim in google, but does java have a premade function to do so?

Queues of Items with Processing Time

1714 byte By norana at 2007-10-2 4:18:09
I need help with this algorithm. I can't figure out the procedures...A factory has 2 machines of type A and 1 of type B. Items to be processed are put in two Queues, each item has a certain AProcessingTime and BProcessingTime. The items move from the two queues to be processed by the machines ...

Prime number problem.

1633 byte By JimboPa at 2007-10-2 4:21:18
I'm trying to create a simple program that tells me if the number entered is a prime number or not. I'm kind of stuck... I think it the problem is more with the math than the actual program itself. This is what I got: import java.util.*;public class Ch5Prg7{static Scanner console = new ...

Number to byte array algorithm

163 byte By robinhollensteina at 2007-10-2 4:23:35
If I have got a number, how can I convert it into a byte array? (The first byte represents the number from 1 to 127 (or 255) and so on)R. Hollenstein

quicksort algorithm: does it look right?

1195 byte By uiga at 2007-10-2 4:24:33
I have an array of rational numbers and i am write a quicksort algorithm for it. However, the following one, doesn't have any impact on the array. Ideas?public void quickSort(int low,int high){if (low>=high) return;Rational pivot=array[high];int left=low;int right=high-1;while ...

Regexp-matching large files

573 byte By Bugmastera at 2007-10-2 4:25:49
Hi all,I'm trying to write a program that will process several large text files.The program should perform regexp matching on each file, and retrieve the tidbits of data that match the pattern. The text file is basically a single line of text which could be several megabytes in size.I could, ...

Java util package & UndirectedGraph

508 byte By buteForcea at 2007-10-2 4:36:32
Hi Everyone!I am trying to write a java program, which will use the Java util package to implement the Undirected Graph. I do not know from where I sould start, but I already wrote the interface.I had the same problem when I used the java's built in facility to implement the Linked List. ...

Ternary Search

1482 byte By darek_dadea at 2007-10-2 4:39:23
I have a problem with wirting an algorith for ternary search.This is what I came up with, but it doesn't work properlyint left = 0;int right = a.legnth - 1;while(left<=right){//I am sure that folowing two lines of code are wrong, but I do not know how to change them...int middle1 = (left + ...

recursive combination

313 byte By mehdi62ba at 2007-10-2 4:46:21
Hi experts,I have a string like "abc",now I want to get the combination this string for number k,for example for "abc" and k=2abacbcI realy thought on it but I can't solve it recursivly,I know how to solve it unrecursivly but how to silve this ...

El Gamal Algorithm and Java problem

1322 byte By fai_hasana at 2007-10-2 4:47:43
I was trying to implement the El Gamal algorithm in java, but the problem is with the last part. I'm not getting the value of Message but according to algorithm i should get the value of message. Can anyone please tell me what did i do wrong?theory says, msg = x * (z^a)modInverse(p);import ...

Lattice of a Directed acyclic graph

196 byte By LeonLLa at 2007-10-2 4:51:02
Hi all,What is a lattice of a directed acyclic graph?What is the general algorithm to determine if a given DAG is a lattice?I don't know how to start..Thank You

El Gamal Problem 2

4743 byte By fai_hasana at 2007-10-2 4:53:42
import java.math.BigInteger;import java.math.*;import java.util.*;class ElGamel2{BigInteger p = new BigInteger("0");BigInteger x = new BigInteger("10");//works if x devides by 10BigInteger k = new BigInteger("7331");//BigInteger g = new BigInteger("1173");//BigInteger msg = new ...

Collision Detection

342 byte By scolari21a at 2007-10-2 4:56:25
Im trying to find some simple sample code on collision detection. Ive been looking on the internet for some but there is f*** all out there.Would anyone please be able to put up some sample code of a sphere colliding with a cone or something like that.Havent had much luck over in the java ...

java.nio.Buffer why such a strange implementation

665 byte By pifpafpufa at 2007-10-2 4:58:37
When I think `buffer' the first thing that comes to mind is a circular buffer. The API would provide available/read/get and free/write/put but there would not be this confusing flip() business like with java.nio.Buffer. Off hand I could not say which one is more efficient in different ...

Implement AVL trees

192 byte By Hypnagoguea at 2007-10-2 5:03:27
Hi,,How to implemet AVL trees and obtain the following by simulation such as the average number of search time,the average number of rotation per insertion and deletion...

BST Algorithm

268 byte By mdorison@a at 2007-10-2 5:05:00
I am trying to design an algorithm that will remove the second largest value from a Binary Search Tree with time of O(height). Can anyone give me some insight witht this? It doesn't seem like it should be that hard but I think I am just hitting a mental block.

Spherical Texture

639 byte By MarkFairchilda at 2007-10-2 5:05:12
Is there some technique for representing spherical textures, or other spherical blocks of data? RAM is naturally suited to representing linear and rectangular textures and data, but how would you represent a sphere? It's easy enough to just map a rectangle onto a sphere (and vice versa), but ...

Search efficiency problem

483 byte By sudarshan_sharma22a at 2007-10-2 5:08:32
I have to search for a particular String from a large number of String(Number of Strings may go in thousands or lakhs.).So I decide to use a HashMap for storing the Strings, which would be fast because of Hashing. For few thousand records, this technique works very good. But when the number of ...

LZ32.dll equivalent in Java

195 byte By jagsa at 2007-10-2 5:08:44
The file lz32.dll, is used when compressing or expanding files stored used the LZ compression algorythm.Is there an API or component in Java which has implemented the same algorithm

Wich datastructures for this introductional AI project

1016 byte By WillTrya at 2007-10-2 5:10:34
Hello.The idea is about having a small project using some AI techniques. This is for learning purposes (intro to AI techniques).Agents are simple cars and the map is a simple 2D grid. The agent doesn't know the road (map) where it was created. It's the job of the agent to find out stuff ...

search identical rows in a String[][]

782 byte By jochima at 2007-10-2 5:15:06
input:-a Table: String[][] inoutoutput:a Table: String[][] outputWhat do I have to do whith it?In the input some rows will be identical to eachother.ex.for (int i = 0 ; i < input[0].length ; i++)input[x][i].equals(input[y][i])what I do now is:start at row 0;for( all the input rows)take the ...

help needed with recursion algorithm..

1018 byte By rukiaa at 2007-10-2 5:22:23
I can't seems to figure out which recursion method to use, if anyone can give me some advice, pls do..Input: There is a row of n elecments with the initial value of 1. Output: Change all the 1s to 0s using the following conditions.-The first element can change from 1 to 0, and 0 to 1 at any ...

Need help with array manipulation

2552 byte By geniewiza at 2007-10-2 5:23:57
Hey there. I'm writing a piece of code that basically removes a specific character from the array and here is the method for it. What it's supposed to do is get input from the user on what character to remove form the array, and once that character is inputted, the program should find the ...

Need help with Tables Handling

351 byte By calaco007a at 2007-10-2 5:25:33
This is a tricky problem, maybe not for you guys, here it is:I have a table with 4 colums and N rows, i want to write data (int) on the 1st and 3rd columns and In the 4th column I want to show up the result of 1st X 3rd (1st times 3rd), I tried many times but so far I've got nothing good, some ...

BreadthFirst traversal of a tree with N children and Deque

190 byte By uiga at 2007-10-2 5:27:21
Is there another way to do BreadthFirst traversal without using a Deque? Is this way faster?I don't think there is a Deque in the 1.5.0 api; can somebody confirm?Thanks

Binary Search Help

654 byte By Princea at 2007-10-2 5:29:12
Below is the coding for the binary search:public class Binary_Search_{public int binarySearch(int arr[],int key){int low=0;int high=arr.length-1;while(low<=high){int middle=(low+high)/2;if(key==arr[middle])return middle;elseif(key<arr[middle]) high=middle-1;else low=middle+1;}return ...

Array Of Varying Size

560 byte By Princea at 2007-10-2 5:33:16
HiI need to create an array of user defined length. Basically i want to allow the user to enter the length in an dialog box or similar and then the array will be created of that size.The array will then be filled with randomly generated numbers.Then i need the array to be sorted quickly.I CAN ...

Returning Largest 5 indexs Of Array of double

271 byte By mm_treoa at 2007-10-2 5:44:40
Okay here is the deal,I have a double[] of size N, I need to return in an int[] the 5 index values of the 5 largest doubles in the double[] array. int[] fiveBiggest = findBiggestFiveIndexes(double[] input);Anyone got a fast algorithm for this?

Need some help please!

2021 byte By Princea at 2007-10-2 5:45:19
Can someone tell me a nice way of changing the code below so the size of the array, N, can be easily changed through the input from the user.import java.util.Random;/**This class contains utility methods for arraymanipulation.*/public class ArrayUtil{/**Creates an array filled with random ...

Simple K-means implementation

319 byte By mm_treoa at 2007-10-2 5:47:22
I have looked around and found nothing.I am just trying to come up with a good way of starting off the centroid centers for a k-means algorithm I am working on, giving them random double values doesn't seem to be producing good results.I am trying to find a simple implementation of the ...

ASCII to Binary

372 byte By kbradleya at 2007-10-2 5:47:26
Is there a Java class or method to convert a text file into a Binary Blob to be sent in a message over middleware. The text file contains strings of character and numeric values so I would ideally like a code that will directly convert the text file into binary. Please let me know if you are ...

Artificial Intelligence Library

640 byte By r.hollensteina at 2007-10-2 5:48:14
Hi out thereI was just wondering if anyone would like to participate in a project to develop an AI Library. That library would include a set of AI features that would read their configuration from an XML file on startup and act upon that. The features would be:1. ANN: Artificial Neuronal Net2. ...

color generation

512 byte By Servant@AKa at 2007-10-2 5:56:32
hello all,I'm tryin to find a solution to the following problem :suppose i have a variable Integer n from 1 to max .I want to be able to generate an array of colors verifying this condition :The colour should correspond to the 'number' attribute, with 'number'=1 being 100% green and ...

Natural Language Processing Using Java

1453 byte By GokulKannanJeyapaula at 2007-10-2 6:02:38
Hello Friends,Im just a new comer with Natural Language Processing.I want to actually know the process or the Java Language Packages and features that can be implemented in Natural Language Processing.I would like to know if theres any particular alogorithm which i can implement in java to ...

System.nanoTimer()

3205 byte By Princea at 2007-10-2 6:02:48
I upgraded to JDK 1.5 and I used the System.nanoTimer() method to determine the running time of my algorithm since System.currentTimeMillis() methos was giving odd results.However when I complie the code it says "cannot find symbol - method nanoTimer()".Does anyone have any reasons why? Maybe ...

My algorithm needs the finishing touches please help me!

6208 byte By Princea at 2007-10-2 6:03:15
public class ArrayUtil { /**Creates an array filled with random values.@param length the length of the array@param n the number of possible random values@return an array filled with length numbers between0 and n - 1*/public static int[] randomIntArray(int length, int n){ int[] a = new ...

Top 5 Algorithm

416 byte By aajiza at 2007-10-2 6:04:18
Hi allI have to solve a problem at work. Assume 20 items (A,B,C,D etc) are owned by a group of 10,000 people in various combinations (permutations are not important). Something likeOwners {Items}Owner1 {A,C}Owner2 {A,B,C}Owner3 {B,D}Owner4 {G}Owner5 {C,A}and so on.I need to know which top 5 ...

String search algorithm problems

4115 byte By nottinghamuni_csa at 2007-10-2 6:08:33
Hi im trying to get the program below to work, the method "naive" is redundant but works, its just there to show you what im trying to do. isSpam should be passed a message, and it then needs to use the patterns located in spamPatterns (just a text file read in and separated into separate lines ...

Registration Systems?

1026 byte By tanseya at 2007-10-2 6:09:28
I have recently written a simple program which I am going to sell to a group of 30-40 people. I have the program completely finished except for the registration system. I've never sold any of my programs before, so I have no idea how to approach this. These people all know each other, and what ...

Algorithms for checking if all elements in array are unique

270 byte By mike_sotoa at 2007-10-2 6:11:05
Hello,I have to compare and find out efficient algorithms for finding out whether all elements in array are different of notCould you please suggest some more efficient algorithms to implement and compare in Java?Thanks in advance,Mike

3D graph drawing algorithm

127 byte By abenstexa at 2007-10-2 6:13:01
Hi everyone,just wanted to ask if somebody knows a nice algorithm for drawing 3d-graphs.ThanksChris

Convert String value to variable

229 byte By lghm@aeiou.pta at 2007-10-2 6:23:03
HiIs possible to convert the value of String to one variable?Is like the eval() function of javascript, but in this case in java/jsp.Anyone know how to do this.Thanks in advance.Lu韘 Matos