Automaton Determinisation and Reduction algoritm

814 byte By evanzsa at 2007-9-29 7:38:53
This is just out of curiosity, but have any of you ever try to code algorithms to go from a NDFA(Non-Deterministic Finite Automaton) into a DFA(Deterministic Finite Automaton), or I'de say those that define regular language?. What is that O (or even better, the Theta of it) of it? What about ...

Wierd number removal algorithm

4370 byte By DreamWarriora at 2007-9-29 7:40:35
Hey all, this is my first post here, so please bare with me. For the last week I have been tinkering with optimizing an algorithm to remove numbers from a randomly ordered input set and a base set such that after I remove them the two sets are identical. Currently I have a recursive solution ...

complexity of nextInt method in class Random

146 byte By kerevia at 2007-9-29 7:43:02
Hi, someone can tell me what is the complexity of nextInt(int n) in class Random?I need the upper bound (Big O). is it O(1) ?

sorting with TreeMap vs. quicksort

854 byte By ahaweba at 2007-9-29 7:49:50
I've been sorting lists by throwing them into a TreeMap then retrieving them in order (especially for fairly evenly distributed lists of strings), thereby leveraging its binary tree characteristics.My belief is that sorting this way takes N log N time, just as quicksort (as in Arrays.sort) ...

randomInt(min,max) (newb help please!)

385 byte By dafrostyonea at 2007-9-29 7:51:19
if this is in the wrong section please move it.I'm very new to java and have been given a progect to do for college over the summer (no help from teachers :( )i have to create and print a random integer using:int randomInt(int min, int max)i have to do it using that, thats all ive been ...

untangling graph nodes

1460 byte By oldmicaha at 2007-9-29 7:53:21
Imagine a graphical class browser where the graph is generated from the source code and each class' interactions are connected by lines. (interaction could be inheritance, ownership, etc) In laying out plotting the class elements, the lines cross. i.e. (ascii art to the rescue!)AB- C \|/\ | /\ ...

Recursive combination method (algorithm)

490 byte By kbw1022a at 2007-9-29 7:53:31
Hi,I am trying to write a recursive method that will show all the teams that can be created from a group (n things taken k at a time). For example, I may have a max group size of 26 letters {A to Z}. My input my be something like groupSize = 6 and teamSize = 3. I need to find all the possible ...

UK Grid reference to screen coordinates (maths not good)

936 byte By J2ME_Philla at 2007-9-29 7:56:44
Hi all, I'm having trouble getting my head round how to translate some grid reference coordinates into screen coordinates including a scale. The three things i'd pass to the method would be something like thispublic int[] translateGridRef(int gridCoords[], int[] screenSize, int scale)Through ...

Modified TSP Heuristics

311 byte By terrykocha at 2007-9-29 7:59:16
Does anyone know of a TSP algorithm that, instead of looping back to the origin, has 1 origin, a destination, and does a least cost route through the rest of the nodes? I would think there's some modification of nearest neighbor that takes "stragglers" into account as it ...

advanced bit masking across bytes

2076 byte By plumonea at 2007-9-29 8:04:55
Hi,Does an algorithm such as this exist in Java?I have a byte array that has been populated after reading in a binary file. I would like to at a different specific points in the loaded byte array grab sets of bits.The algorithm would be something like thisStarting at element x in the byte array ...

Order Objects in a List

432 byte By michaelc411a at 2007-9-29 8:08:05
Hey dude,I have a quick question on using a List.I want to store objects in a particular order:ex.list.add(2, object1);list.add(0, object2);list.add(1, object3);Then iterate through the list:(Object)list.get(i);/// returns object2, object3 and object1 based on the id in the add method.What's ...

What implemented classto be darastructure for Graph?

274 byte By sorawonga at 2007-9-29 8:22:37
Does anyone know a class that can use to implementing graph model?I want to use graph model in my program. Does java already have it?(PS. i also need help on Disjoint Set[what class ?]);My homework would be easier if i use java, isn't it?

Any comments about JGraphT?

465 byte By Linda_Buismana at 2007-9-29 8:30:07
Hi,I'm designing the data structures for representing simple undirected graphs in my application, and came across JGraphT http://jgrapht.sourceforge.net (it's also been mentioned in this forum).If there's anyone here who's used JGraphT, could I get some feedback on the scalability etc? I'm ...

Java sound

456 byte By andrewjj20a at 2007-9-29 8:53:08
I am trying to run sound through an algorithm, yet to be determined, and I need to move information from an input source run the algorithm, then out put it, the information will either be 8-bit , i know how to process this, or 16-bit signed, this I need to turn into a form that I can use, then ...

sound algorithms:fft

111 byte By andrewjj20a at 2007-9-29 8:56:28
can anybody help me with comming up with an fft spectrum analysis of a sound, either byte array or file.

Hashcode

711 byte By upux.upuxa at 2007-9-29 8:58:23
Hi, my question is about using hashcode. For example if i have got to String objects1 - apple = hashcode is 930292102 - pear = hashcode is 3436774class Teneke {public String a ;public String b ; public int hashCode() {return a.hashCode() + b.hashCode();}}public class BasitTest {public static ...

Hashcode

1037 byte By upux.upuxa at 2007-9-29 8:58:29
Hi, my question is about using hashcode. For example if i have got to String objects1 - apple = hashcode is 930292102 - pear = hashcode is 3436774total is 96465984Are they anyway to find that "apple=93029210" is in this total; like taking mod (%)Here is sample ...

Best possible Tracing and Debugging mechanism

180 byte By sasanplusa at 2007-9-29 9:15:59
Hi,In a real-time program which performance is the most critical factor, what is the best idea for tracing and debugging the program execution.Thanks,S.

Logic to find the updated entity

577 byte By RajSenthila at 2007-9-29 9:17:45
Hello, I have an entity WHOLE(PERSON) which contains one or more PART entities(CONTACTS, ROLE, etc...). The user can update any of this entity. To find out what are the entities that user updated I remember using the logic like giving a number to each entity WHOLE ENTITY 1 PART ENTITY1 2 PART ...

angle between two points

191 byte By asjfa at 2007-9-29 9:23:28
hi, if I have two points Point2D.Double p; Point2D.Double q; how do you find the angle between them (measured from a vertical bar)?thanks,asjf

producer consumer puzzle

664 byte By nitinp_bioinfa at 2007-9-29 9:23:51
Hello All,I have two arrays with meProducer arrayP1,P2,P3,P4,P5...PnConsumer arrayC1,C2,C3,C4,C5...CnLet us take arrays having 5 elementsP1 P2 P3 P4 P51 2 3 4 5C1 C2 C3 C4 C554 3 2 1The output should beResult1(P1,C5),(P2,C4),(P3,C3),(P4,C2),(P5,C1).Results ...

multiple zip with same zip compression

2989 byte By gilroittoa at 2007-9-29 9:30:31
Hi,I have a number of small texts, say 100-1000 bytes. They contain similar kind of texts and if I zip with all of them together it gives excellent compression. However, I need to zip them 1 by 1, since I will later access only one of them and I don't want to fetch all texts, I only need one. ...

revised producer consumer puzzle

476 byte By nitinp_bioinfa at 2007-9-29 9:33:11
Hello All,I have two arrays with meProducer arrayP1,P2,P3,P4,P5...PnConsumer arrayC1,C2,C3,C4,C5...CnLet us take arrays having 5 elementsP1 P2 P3 P4 P51 2 3 4 5C1 C2 C3 C4 C55 4 3 2 1P1 P2 P3 P4 P51 2 3 4 5C1 C2 C3 C4 C55 4 3 2 1The output should ...

Algorithm to Generate License Key from User's Name

231 byte By philmakera at 2007-9-29 9:36:22
I'm looking for an algorithm to generate a license key from a person's name. I've been searching these forums and the web all day but haven't come up with much.Can you give me any ideas?Thanks,Philip

Anyone recognise a standard problem here?

455 byte By YATArchivista at 2007-9-29 9:55:51
I have a problem which is so simply stated it seems that it must be a classic, but I don't recognise it as one. Can anyone point me in the right direction?Given:Set SSet Zs = {0, |S| - 1}Symmetric function f : S x S -> N (or R if you prefer)Symmetric function g: Zs x Zs -> N ...

Java for Simulation

702 byte By detlya at 2007-9-29 10:24:05
I wanted to seek people's advice on using Java for simulation of physical/numerical processes, for example (but not only), Monte Carlo simulations. Are there any distinct advantages/disadvantages in using Java over, say, Fortran, C++ or other, more common (indeed, more "acceptable") languages ...

Capitalizing words in a string

472 byte By paultaylora at 2007-9-29 10:33:17
I have written a method using the Pattern class to capitilize the first letter in every word but isnt very sophisticated. For example it breaks words at apostrophe boundaries creating two words from one.I was wondering if anyone had written a more sophisticated method I could steal .I was also ...

Problem

494 byte By Zoroastrua at 2007-9-29 10:38:52
Hello!Here is my problem:I have n squares. For every i in the set {1,...,n} the square s_i has the next properties:- the length of its edge is a_i- the coordinates of its bottom left point are x_i and y_i and they are greater than 0.What is the area covered by this squares ?I would like an ...

Print diamond shape

286 byte By xyqa at 2007-9-29 10:41:05
Hello friendsI want to print this diamond shape by using nested for structures**** ***** ******* ********* ******* *********How do I get started ?Does anyone have sample codes ?Thank you !

drawing a DAG

273 byte By tlozinaa at 2007-9-29 10:42:33
I need advice on how to go about drawing a DAG (directional acyclic graph). Alot of stuff on the Internet about traversing a DAG and analyzing a DAG but I couldn't find any info about a algorithm to actually draw the graph. Anyone know any resources that can help ?

Help me!! for both classes

665 byte By blur.kida at 2007-9-29 10:51:50
Hi.I have 2 program.First program is to open and choose the file to run so it will display the choosen file's path and filename and most importantly - its results on a Window.Second program is design to run an external file e.g. music.mpeg and count number of services inside this file.Question ...

Convert DOS to Java

276 byte By b00gera at 2007-9-29 10:55:23
Hi everyone, I wanted to know if you could help me conver the following DOS code to its Java equivalent. Thanks in advance for any help...<code>for %%i in (*.crd) do call ..\run-xalan %%1 ..\MapToDeconflictor.xslt ..\goodxmls\%%1</code>

After OCR - > Put the text into the correct reading order

1548 byte By mcrunnera at 2007-9-29 10:57:37
I'm working in a programa that have to read PDFs to extract some data.Till this moment i've extracted the text objects with the size, font, text and position (x1,y1,x2,y2). After that the program recognizes text blocks and achieve again its position.The document can have 1,2 or 3 columns and ...

Invers sinus function

143 byte By thaldyrona at 2007-9-29 11:01:45
I would need an invers sinus function but i couldn't find anything about it in lang.Math..Or did i miss something?regards

ternary knapsack problem

406 byte By byryndyka at 2007-9-29 11:02:21
Hi,I am trying to create recursive method for ternary knapsack problem.Int n - (number of items I could take,leave or take 2) is 1<=n<=14.The output should be exactly:ex:0000 0 00001 5 100002 3 8 .. Where 1st colomn represents items I took,and 2nd and 3rd colomns are some values ...

fillet betwenn two lines

150 byte By lesmaresjaunesa at 2007-9-29 11:02:23
Hello!Is there an algo to solve the position of the tangent points and circle center between two given lines?ThanksMaelvon

2D Gauss fitting

157 byte By feleexa at 2007-9-29 11:11:11
Hi !I have a matrix 11x11 and I need a 2D Guassian Fitting algorithm !Does anyone know where i could find one ?ThanksFelix

Work with images

331 byte By Jackie_rua at 2007-9-29 11:11:21
Hi! There is such problem: on mouse click on the certain picture, it is necessary to distinguish in what area of a picture have got ( transparent or color ). Whether there is a ready decision of this problem? Clearly, what it is necessary to receive bitmap a picture and to address to parameter ...

Arg, stack over flow...

586 byte By RGbeana at 2007-9-29 11:16:57
I'm working on a equation parser (using recursion).I'm getting a stack over flow error on the first recursive call by making with parameters consiting of only:1) 1 TreeNode containing a very short string2) 1 ArrayList containing only 1 element at that time.Now I'm confused about how stack ...

problem using array lists

4354 byte By nitinp_bioinfa at 2007-9-29 11:17:59
Hello All,I need to write a program to accomplish this.if we have a set of Producers and a set of ConsumersegP1 P2 P3 P4 P55 67 8 9C1 C2 C3 C4 C51 34 21As a first step I need to find out the all the sets of {Pi,Ci} where Pi >= Ci and store them.I am not supposed to use arrays or any data ...

Interesting problem

786 byte By nitinp_bioinfa at 2007-9-29 11:22:16
Hello All,We have two sets A={1,2,3,4,5,6}B={5,6,7,8,9}I am not sure if this is B * A with condition Bi<=Aieg :Answer needed is(5,1),(5,2),(5,3),(5,4),(5,5)(6,1),(6,2).....(6,6)(7,1)....(8,1)...(9,1)...The sets could be as long as the user wants.In case there are no pairs that satisfy the ...

Interesting problem

787 byte By nitinp_bioinfa at 2007-9-29 11:23:28
Hello All,We have two sets A={1,2,3,4,5,6}B={5,6,7,8,9}I am not sure if this is B * A with condition Bi<=Aieg :Answer needed is(5,1),(5,2),(5,3),(5,4),(5,5)(6,1),(6,2).....(6,6)(7,1)....(8,1)...(9,1)...The sets could be as long as the user wants.In case there are no pairs that satisfy the ...

Interesting problem

4012 byte By nitinp_bioinfa at 2007-9-29 11:36:39
Hello All,This is the problem I am stuck with right now.I have two array lists one producer array list and one consumer array list denoted by a and bP1 P2 P3 P4 P55 6 78 9C1 C2 C3 C4 C52 3 45 6Now we find all those producer consumer pairs which satisfy the criteria Pi>=CiWe have the ...

still stuck with the same old producer consumer weight problem need help

5474 byte By nitinp_bioinfa at 2007-9-29 11:42:09
Hello All,This is the problem I am stuck with right now.I have two array lists one producer array list and one consumer array list denoted by a and bP1 P2 P3 P4 P55 6 7 8 9C1 C2 C3 C4 C52 3 4 5 6Now we find all those producer consumer pairs which satisfy the criteria Pi>=CiWe have the ...

Binary Tree depth

151 byte By dsalhanya at 2007-9-29 11:49:36
I have a simple binary search tree and was wondering if anyone had a good algorithm to determine the number of levels the tree has.thanks

Need help on finding Running Average

915 byte By snguyent4javaa at 2007-9-29 11:49:59
Hi! Can any one help me to progam K-number Running Average in java? A K-number running average of is the arithmetic average of the last K values in the list. When a new item is inserted in the list, a new running average is recomputed on the last K values. examples of 6-number running average: ...

Vending Machine Problem

1327 byte By jim_zikeha at 2007-9-29 12:02:21
I have difficulty solving the following problems:A vending machine must be able to determine a way of returning the change. In order to do so, one must be able to find the number of different ways to give exactly K cents in change. Please write a program using recursion to find such a number. ...

implementation of depth-first algorithm

1191 byte By byryndyka at 2007-9-29 12:03:09
Hi, I am trying to implement depth-first algorithm.(directed graph, no loops). Here what I have so far.//form a one-element stack with the root node.Stack st=new st(); boolean goalflg=false; st.push(?)//do I need to clone the value from the tree, if yes, how can I do this? Should it be a ...

Need help in Computing the Fibonacci numbers

795 byte By snguyent4javaa at 2007-9-29 12:04:42
Can anyone helps me on this program? Each term of a Fibonacci sequence is defined to be the sum of the previous two terms of the sequence, where the first two terms are intialized to 1. For instance, x0 = x1 = 1 (first two terms)x2 = x1+x0 = 2 (third term)x3 = x2+x1 = 3 (fourth term)x4 = x3+x2 ...

Recursion Problem - Karel

1095 byte By lexi_27062706a at 2007-9-29 12:05:11
HiI'm currently using Karel the Robot. I have a problem where Karel has to retrieve a beeper at the west wall and return to the corner on which it started. I have to use recursion - no iteration. I also cannot use instance variables( so I can't use an index to know how far the robot is to ...