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 = ...
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 ...
Are there classes openly available that perform the PID calculation (if so, where?)
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......!!!!!!!!!
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
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 ...
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
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
I have seen the actual algorithim in google, but does java have a premade function to do so?
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 ...
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 ...
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
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 ...
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, ...
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. ...
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 + ...
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 ...
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 ...
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
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 ...
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 ...
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 ...
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...
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.
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 ...
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 ...
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
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 ...
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 ...
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 ...
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 ...
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 ...
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
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 ...
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 ...
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?
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 ...
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 ...
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 ...
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. ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
Hi everyone,just wanted to ask if somebody knows a nice algorithm for drawing 3d-graphs.ThanksChris
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