Binary trees

4390 byte By Lisa_ga at 2007-10-2 17:29:14
I haven't been doing Java long and now getting into the more difficult things. I am simply trying to program a binary tree and insert nodes with data. The code I have so far is: class tree_node{private Object data;//data stored in nodeprivate tree_node left;//reference to left nodeprivate ...

Get map values by by row or key

842 byte By javvvaa at 2007-10-2 17:29:43
I need to get linked map values by row or key. Row numbers are sequential and simply correspond to order the values inserted into map.An example:ROW...KEY......VALUE======================0.....GOOG.....GOOGLE1.....SUNW.....SUN2.....ORCL.....ORACLE/* Get value by key */get("GOOG") = ...

Combinations of integers

3297 byte By some1stolemyusernamea at 2007-10-2 17:30:12
Hello is there anyone there who can help me? I am writing a program that evaluates poker hands. I need a way of creating all 2 card combinations from the list of all cards not yet dealt.I have 4 arrays that store the undealt cards off each suit. I now need to search one of the arrays and find ...

Returning a ratio

1873 byte By syncroa at 2007-10-2 17:34:35
Hey allI am trying to calculate the "popularity" of an item. Items can be rated using integers from 0 to 5. What I do now is that I only calculate the average of all the ratings for an item, this is of course not enough because the number of times an item has been rated should also be an ...

Beta distribution

89 byte By Mickael_javafana at 2007-10-2 17:35:39
Is there anyone who know a function to compute a beta distribution ?Thanks.

Security

72 byte By Raghavaa at 2007-10-2 17:36:55
I would like to fetch CPU id. Could i get any algorithm to Fetch.

Drawing Triangle

633 byte By secret_codera at 2007-10-2 17:50:08
Having Trouble below.....where the astericks are.....any help would be greatprivate int side1;private int side2;private int side3;private boolean firstTime = true;public DrawingJPanel( String name){ super(); setBackground( Color.white ); setBorder( BorderFactory.createTitledBorder( name ) ...

How to match?

530 byte By luqiyia at 2007-10-2 17:56:34
Say if I have a set A of people, each person in this set has knowledge on some of subjects. Now I have a new comer, with knowledge of some subjects. I want to find the person in A whose knowledge set is best to match the new comer. Is there good method or algorithm to do this job.Further more, ...

Output format?

649 byte By patucosa at 2007-10-2 17:58:02
Hi everyone in the forum,I do not know if i should post this question here, but i think is the best place. Sorry if i were wrong.just a question because i have no idea how to format the output i need.I have a REAL *8 and the output restrictions shows that it should be: 1.0000 D-08 if the value ...

replaceAll method

315 byte By samraa at 2007-10-2 18:03:40
helloi am new to jsp i am writing a code for sortingbut when i compile it gives me the error i am using jbuilder 7"SORT.jsp": Error #: 300 : method replaceAll(java.lang.String, java.lang.String) not found in class java.lang.String at line 40please tell me ...

Graph isomorphism

867 byte By Alg_O._Rythma at 2007-10-2 18:03:53
I'm looking for an algorithm to determine if two graphs are isomorphic or not. I don't need the isomorphism itself. I know that this is a hard problem, and that it might be an NP-complete problem, but right now I'm using the naive method, where I permute all the vertices in the graph - just ...

big-Oh help

599 byte By sdpa at 2007-10-2 18:07:00
Hi guys, I'm reading some notes about big-Oh, but some points really confused me.First, there is a theorem on the notes that says (lg( n))^x is O( n^y ), for any constans x, y in R. Can anyone please tell me why? and how should the constant y be determined? Is y the power of n in lgn on the ...

Mathematical numbers in java

9894 byte By raindropa at 2007-10-2 18:11:14
The task is taken from post: http://forum.java.sun.com/thread.jspa?threadID=729292But it is very interesting problem. So I would prefer to discuss it in this forum.Define an Arith interface giving the add, sub, mul, div, abs methods to be supported for any number type.Define an Int class that ...

pseudocode help

286 byte By jksullivana at 2007-10-2 18:12:52
can someone provide me with assistant in writing pseudocode - some online links perhaps.I need to write a vending machine pseudocode.the vending machine is very simple, no currency conversion involved, only one drink in the machine.can someone please. thanks

How to find longest string?

59 byte By bonoza at 2007-10-2 18:17:00
How can I find the longest string in a string array?

Fourier Analysis in Java?

545 byte By compadrea at 2007-10-2 18:17:19
I am a physicist working on Fourier series and transforms, and I am too lazy to do it by hand. So I decided that I would program a "Fourier" class to transform a function.The problem is that it is very difficult to do with object oriented programming (though I suppose one could make a function ...

Building a Tree from array elements

538 byte By qwedwea at 2007-10-2 18:20:07
Hello everyone,I would like to build a tree structure from the elements of a sorted array. If the array is full, then it should split. A parent node is created and the elements of the array are placed in both left and right nodes of the parent.The middle element of the array becomes the parent ...

System.nanoTime() inaccurate?

902 byte By chris0a at 2007-10-2 18:22:18
Hi,I'm trying to do some accurate timing over long periods. I require at least sub 5ms accuracy over a number of years. Because System.currentTimeMillis() is only accurate to the system accuracy (which on Windows could be around 55ms) I am using the nanosecond timer as an offset from a base ...

Trouble Displaying Buttons in aGUI

5930 byte By some1stolemyusernamea at 2007-10-2 18:23:38
Hello there,can anyone take a look at this very short piece of code and tell me why my JButtons are refusing to show up!/** * Validate.java * * * Created: Mon Apr 24 13:02:50 2006 * * @author <a href="mailto:Samuel@EL-DIABLO"></a> * @version */import java.text.*;import ...

when to go for Breadth first search over depth first search

217 byte By ajay_it01@yahoo.coma at 2007-10-2 18:25:54
hi,under which scenarios breadth first search could be used and under which scenarios depth first search could be used?what is the difference between these two searches?Regards,Ajay.

Please advise me about calculating length

376 byte By Bat_a at 2007-10-2 18:26:24
Dear all,I am converting a file which is encoded as ASN.1/BER. While I converting that file almost of it goes fine. But some record length is more than 256 is confusing problem. Java byte is not unsigned, so its values are -127...0 ... 127. I can calculate length that is lower than 256. How can ...

1D FFT. Where to cut?

343 byte By Ssjina at 2007-10-2 18:28:17
Hi,I'm using FFT algorithm on a vector data of 4096 elements, so i get a vector of 2048. I need to cut high frequencies, but i cannot understand where i should cut the vector. Time step of original data is 0.004 secs (Camp Freq=250Hz).Can someone explain to me how can i do the cut? (i.e. at ...

Controlling a thread's processing time

1983 byte By SebasGRa at 2007-10-2 18:30:35
Hey there. I know this subject is found everywhere, but I really couldn't find an answer to my problem... yet :)I have to support Runnable object not written by me, so I don't have access to their source code (decompiling them is not an option). So, I can't rewrite the run() method. ...

combining .java files

269 byte By justaregulara at 2007-10-2 18:32:25
i have 3 .java files that make up an application. DrawJPanel.java Elevator.java and MyRectangle.java.............i would like to put DrawJPanel.java and MyRectangle.java into Elevator.java.....and i'm not quite sure how that works......help would be appreciated

Calculating Fan in / Fan out of a metrics project

946 byte By mchiciaka at 2007-10-2 18:45:27
Hey I am in the process of a coding a OOD metrics project. I am 90 percent done I just need a few more metric measurements to add to it, and two of the hard ones are fan in and fan out.The project consists of a GUI which allows opening of multiple files at a time, so it gets all of the java ...

Creating freqeuncy bars

872 byte By Jason_Homea at 2007-10-2 18:46:03
Hi,I'm trying to implement frequency bars (the ones that you would see in winamp or media player) where the bars change as an audio file progresses. e.g.I抦 starting with .wav files to keep things simple and so far I抳e created an application that reads a wav file and plays it and I can extract ...

Weighted Regression

7966 byte By regression_seekera at 2007-10-2 18:47:15
Hi, I have some difficulty to program the weighted regression in Java. I will be very thankful for anyone who could give some assistance on the implementation of weighted regression. Actually, I find a java code about regression (not weighted regression) from Google. But I do not know how to ...

CRC32C checksum in Java

332 byte By ejnelsona at 2007-10-2 18:53:06
I'm having a hard time finding a java implementation of CRC32C checksum.There are some C versions from linux that I have found and attempted to convert to Java, but with no success yet. Anyone know of some existing code or be willing to at my code to help me figure out what I'm doing ...

robin-karp

236 byte By Dynamic_textFieldsa at 2007-10-2 18:54:12
I am doing work in pattern matching. And in that i want implementation of robin-rapk algorithm.If any body has implemented this algorithms, please give me the code. If not then any body help me implementing this algorithm.

Dynamics Matrices

1302 byte By compadrea at 2007-10-2 18:56:48
I am trying to make a class of something called tensors. What the user puts in is an integer which defines the rank of the tensor.What the rank does is it tells us how many "[]" operators there will be. So a rank 1 tensor would have private Object[] myStuff;a rank 2 tensorprivate Object[][] ...

reRoot algorithm

267 byte By scopriona at 2007-10-2 19:11:38
I`m looking the algorithm reRooting a binary tree:reArange the pointers of the roots (and leafs) and create a new Tree from a chosen root ( =one of the subTrees of the original root).(A Tnode holds data, and pointers to the left and right Tnodes.

Indexing techniques

267 byte By krivina at 2007-10-2 19:17:11
Hello everyoneThis is my first post in this forums. I want to implement some indexing techniques. I don't know how to start indexing. Can anyone give me an idea how to start it or a sample code will be appreciated.Thanks in advance

AVL tree balance factor

2046 byte By Narka at 2007-10-2 19:19:05
hi there,At University we need to add an algorithm to calculate the balance factor of each node in an AVL tree without using the hight to calculate it.All we are alloud to use is the int bal attribute and the matching int getBalance() and chageBalance(int bal) Methods supplied in the node ...

Algorithms that convert recursive functions to iterative form & vice versa

278 byte By alta at 2007-10-2 19:20:46
I have math algorithms in recursive form and I want information on how to convert it to transform it into iterative for faster execution.I also want information on how to convert iterative to recursive algorithms so the code would be more readable.Thank you

How to converting mid to wav?

172 byte By laurcjROa at 2007-10-2 19:24:14
Hello everybody,Could some one help me with an example of how to convert midi files to wave files, or with some suggestions on how to do it?Thaks a lot

Huge tree problem

1310 byte By guy.bashana at 2007-10-2 19:27:30
Hello,I want to store huge amount of combinations in memory. For each combination I want to store an integer value.A combination looks like: 2,4,3,8. For this combination I build a tree composed of nodes: 2, 4, 3, 8. Then for node 8, I set the int value to be 1. if the same combination is ...

Computer Algebra

734 byte By alta at 2007-10-2 19:31:00
Hello,I am writing a computer algebra system and I need help solving a variable in an equation from an abstract syntax tree.How can I make something like a Term Rewriting System that rewrites equation in simplist form? Is there any way to automatically let the computer to combine like terms?How ...

About SVD

437 byte By Adi.Ma at 2007-10-2 19:37:39
Hello,Does anyone know what can I use to calculate the SVD frome a large Matrix? I used Jama Api but for my Matrix (8464 rows and 400 columns) it gives me an Heap memory error at this line:SingularValueDecomposition s = new SingularValueDecomposition(A);I know it is a large Matrix, but Matlab ...

Travelling salesman problem

419 byte By leolandera at 2007-10-2 19:37:47
Hi,I am currently working on a problem where I have to do maze navigationwith obstacles in the maze. I have to implement a TSP algorithm to visit a specific number of locations in the maze in the fastest possible time. I am not quite sure how to start, can anyone give me some help on how should ...

encryption algorithm

121 byte By ashokvec_mca2006@rediff.coma at 2007-10-2 19:46:07
i dont know about encryption algorithm but, in my project i want to do cryptography both encryption and decryption

Determinant Encoding

633 byte By n_azmana at 2007-10-2 19:50:48
Hi,I'm doing research on MST using GA. I have a problem with the encoding to represent the allele. I'm using Determinant Encoding and i don;t know how to get all the combination of determinant code.My problem:i have an array(2D) as below 1231 223453nullnull65null4nullnull7null ...

Array matrix error

2595 byte By r.hollensteina at 2007-10-2 19:58:12
I wrote a simple algorithm to create Julia and Mandelbrot sets, but it always gets the same runtime error.This is my code:/** Gets the set for a rectangle.* Careful with Y coordinates! upwards is greater, not as in programming graphics!*/public boolean[] getSet(int width, int height, double ...

Image comparison

212 byte By Chikua at 2007-10-2 19:59:38
I want to comapre two images, the second image here is a part of the first image i.e. a sub-image . I want an algorithm with which I would be able to check whether the subimage is a part of the first image

Tank Wars In Java.........Any Ideas Where To Start?

707 byte By vlad123a at 2007-10-2 20:01:32
Hey well i have to make a project for my grade 11 computer science class and i wanted to do something hard. i was thinking of a game called tank wars. Here is an example of the game i want to recreate: http://www.addictinggames.com/tankwars.html. I just need to know any ideas any of u might ...

Indexing object

856 byte By Kovicaa at 2007-10-2 20:11:42
Is there any product out there that alows me to index objects?It should behaive much like an database index.What I want is this:I have an object that has four fields(formName, fieldName, propertyName, propertyValue) and I'd like to index this object in order to retrieve it.There are caching ...

Help with random numbers please

760 byte By kRnpandaa at 2007-10-2 20:14:36
Hi, I'm currently makin a program for an independent study project for school and am stumped as to how to set up a certain part of the program. I'm setting up a match card game and I need it to randomly arrange the cards when it starts off. I'm trying to figure out the best way to get random ...

File hierarchy Jtree problem! Please help!

751 byte By Dim3a at 2007-10-2 20:15:16
Hi! I need some help :).I have 2 Vectors. The first is vDirs and that vector contains names of dirs, like this: 1|New Folder;2|New Folder 2; ... The number before the dir is the index of the dir, !not the index of the vector.The second vector is vFiles amd it contains names of files, like this: ...

Union-Closed Families of Sets

6457 byte By h3nrya at 2007-10-2 20:27:15
Hi, I have written a short program in Java that takes as input a text file containing an arbitrary number of mathematical sets (presumably with the property that none of the sets can be formed by union of any of the other sets, although thats not really important) and finds all possible ...

remove specific row and column from 2d array

409 byte By n_azmana at 2007-10-2 20:32:32
Hi,I would like to know how to remove the specific row and column from 2d array.for example, I have the original 4x4 array as below 2-1 -1 0 -1 20 -1 -1 -1 20-1 -1 -1 3let say that i want to remove row 2(bold) and column 2(bold), and the new 2d array should get as below2 -1 0-1 2 -1-1 -1 ...

combining characters

530 byte By r5dtfvtsaba at 2007-10-2 20:34:45
I need to take an ArrayList of characters and print combinations of them. The length of the combinations should be from 1 character long to x (an input number) characters long. The characters in the ArrayList can be used more than once. What algorithm can I use?example:x = 5ArrayList contains ...