Sorting speeds

566 byte By mythicwolf88a at 2007-10-1 8:35:50
I was just wondering how the Arrays.sort() method is so fast. I created my own algorithm and ran it against quicksort and I was happy with the results, but then to make sure I was actually sorting the method correctly I used Arrays.sort() and Arrays.equals() and it finished too fast. My ...

Regular Expressions & parenthesis

1066 byte By mathuoaa at 2007-10-1 8:37:55
Hi, I want to parse (math) expressions. I searched the forum and googled, but i didn't found any (possitive :)) help. What i need is to locate the first substring with a pair of parenthesis. I read that parenthesis matching cannot be done by "one" regex, since there is no way to "count" in ...

I need help >_<

266 byte By sha_83a at 2007-10-1 8:38:57
Hi every body;I just want any codes or website how can I read from a file and what is depth-first and breadth-first search strategiesplzzzzzzzzzzz it is very important if you can give me a site or a description about these codes^_^

java.lang.StackOverflowError on Quick Sort Algorithm

3117 byte By mpento02a at 2007-10-1 8:41:42
i was given the following quick sort algoritm as part of project. We have to Analysis its performance against other sorting algoritms.it works fine for randomly sorted arrays.However when i run a reverse array i get a java.lang.StackOverflowError.I've heard this can be caused by infinite ...

Search Trees

499 byte By Squealsa at 2007-10-1 8:52:01
I've beem fleshing out a data structure API to define and implement data structure type that java.util doesn't (such as graphs and trees), and I've been wondering: Is defining and implementing a search tree type worth it?I suppose my question really is: Is there anything I might to use a ...

Sorting alternating male and female

344 byte By Tave2a at 2007-10-1 9:08:06
Can anyone suggest an algorithm to sort an array into althernating male and female? e.g.Smith MSmith FTaylor MTaylor FThe algorithm needs to disturb the list as little as possible so other criteria can also be used e.g. test scores. Also, it can't be exact because there is rarely exactly 50% ...

QuickSort - complexity question

276 byte By Meshuggaha at 2007-10-1 9:09:13
I have a QuickSort algorithm and I have measured the performance of this algorithm by geting the number of comparisions and copies it performs for a number of array sizes. How can I work out what the complexity is for comparisions and copies?Thanks for the help.

Stackoverflowerror on Breath Search algorithm

4024 byte By hawkeye9393a at 2007-10-1 9:13:02
hey ppl, i need an algorithm that can detect the best path to get in an array from a to b. however,shortest path is not what i need,since there might be a path that goes backwards.anyway i wanted to test the complexity of the algorithm first, and i got an error. however, i don't know if it can ...

Passing data from Microphone to FFT (Fast Fourier Transform) Class

367 byte By Trutha at 2007-10-1 9:13:40
I am quite new to Java and trying to find a way to use microphone and pass the data from microphone to a FFT Class and get the result back as one number (which will be the frequency). Because I am quite new, I am in need of some advice and description to solve this problem.I will be glad if ...

generate a string

7276 byte By rkippena at 2007-10-1 9:13:56
I'm trying to generate a string that represents a sum of products expression.Here are some examples of strings for various degrees:// degree = 2if (t >= knot[i] && t <= knot[i+1] && knot[i] != knot[i+1]) {d = a(i,k);}else if (t >= knot[i+1] && t <= knot[i+2] ...

stemming

4527 byte By sam_desha at 2007-10-1 9:15:51
Hi,Can someone explain the code in the folloiwng- I need a detailed explanationclass Stemmer{ private char[] b;private int i,/* offset into b */i_end, /* offset to end of stemmed word */j, k;private static final int INC = 50; /* unit of size whereby b is increased */public Stemmer(){ b = new ...

get numbers with specific number of 1 bits

581 byte By rkippena at 2007-10-1 9:17:58
Is there a way (instead of going through all the numbers) to output the numbers with only a specified number of bits?For example, take the numbers 0-150000000100100011010001010110011110001001101010111100110111101111If the goal was to output the numbers with only 1 1-bit, then the outputted list ...

Graph Theory

777 byte By mathuoaa at 2007-10-1 9:26:45
Hi, It is easy to see, that graph theory is of great interest for the majority of the Algorithms forum visitors. Since i am going to start writing a graph theory library and I will need help for sure in the near furure, I believe that it would be more helpful for all of us, to post our ...

Impleminyation of MAJPRITY ALGORITHM

835 byte By msasa at 2007-10-1 9:35:13
i want to write MAJORITY ALGORITHM in both recursive as well as iterative manner.i tryed but i could not , can any one help me please.this is the algorithm:Algorithm MAJORITYInput An array A[100n] of n elementOutput The majorty element if it exist; otherwise none.1. c < candidate(1)2. count ...

file problem

214 byte By mihirkapadiaa at 2007-10-1 9:37:59
I have a file in my porject.How or in which format or way I convert that file so someone can not readit or even if they read it wont make sense.But my code if reqd can read file content.

Bidirectional Tree Map with ArrayList

1121 byte By kentkenta at 2007-10-1 9:41:07
Hi-yaI would like to use a TreeBidiMap as implemented in apache commons - http://jakarta.apache.org/commons/collections/userguide.htmlThese represent maps where the the key can lookup the value and the value can lookup the key with equal ease.for example:BidiMap bidi = new ...

Finding limit of logarithm using L'hospital rule

333 byte By darklord12a at 2007-10-1 9:51:56
I have trouble finding derivative of logarithmic function:Supposed I have the following problem: Lim (as n --> infinity) 3(log n)^4 / 3nlog n + 2nHow do I find the limit of the above using l'hospital rule? I need to find the limit to determine the run time whether it is big_O, big_thete, or ...

connect circle

9082 byte By gzmabea at 2007-10-1 9:55:49
Hi, everyone, i need some help here, some of my logic seems gone worng in my application. My program suppose to work as follow: firstly, i click as much circle as i like. After i press the connect button, if i click any of two circle, a line can be draw between their central point. and I want ...

Java implementation

164 byte By arudolea at 2007-10-1 9:57:50
Can someone point me to a link which implements the following conflation algorithms in Java-1. n-gram2. successor variety3. table lookup

Knapsack Algorithm!

229 byte By markjsa at 2007-10-1 10:03:10
Im doing a project about different security alogrithms, and they are coded in java. I cant seem to find any version of knapsack coded in java on the web, can anyone help, or tell me where I could view source code for this?

Problem with regex - String.replaceAll()

675 byte By Bread_Sticka at 2007-10-1 10:03:20
I'm trying to replace all backslashes in a string with double backslashes... but am getting some errors during runtime.Here's what I'm using:str = str.replaceAll("\\\\", "\\\\\\");Here's the error I'm getting during runtime:java.lang.StringIndexOutOfBoundsException: String index out of ...

Calling DB from struts

80 byte By dsn29a at 2007-10-1 10:10:28
I want to access DB from Strutus framework, Pl. suggest the best approach

Worse case analysis?

745 byte By darklord12a at 2007-10-1 10:10:52
k = 0for i = 1 to n dofor j = n down to i dok = k + 1if j < 8 thenk = k + jI am practicing analyzing worse case for algorithms and run across this interesting algorithm (at least interesting to me). What is the runtime of the above algorithm? I think it's N^2 but I am not so sure - looks ...

shortest path with more than one traveler and time constraints

1897 byte By fluffyBunnya at 2007-10-1 10:17:00
Please have a look at this problem...Thank you..(the problem is ok with one traveler. but when two or more come into the picture they really mess things up)Here it isI have a number of destinations that devides evenly up between anumber of travelers. (5 travelers with 20 destinations = ...

Number Combination

457 byte By Anuradha.Athreyaa at 2007-10-1 10:17:45
Hello,I'm trying this program out of self interest. I would like inputs regding where i can start off...My Reqmt is this:..If i have 10 nos... 1,2 3,4,5,6,..10...Everytime i run my program it should generate a different combination of numbers 4 2 5 8 3 ...covering all 10 nos.next time 5 7 3 9 ...

Simple Calculator

1215 byte By davidemma at 2007-10-1 10:23:39
Hey, I'm working on a simple Java calculator and I am looking for some asstance.It's a fairly simple system.I have two stacks containing two different Object types. I have Double and Operator, both are wrapper classes. Doubles are operands while Operators are, well, operators.The program will ...

Multi-variable polynomial

492 byte By SuperDave3343a at 2007-10-1 10:23:40
I'm working on an applet that is required to expand a polynomial with up to four variables. I've written two things that work well for small cases, but both were unable to handle larger cases with all four variables. Here's the largest ...

Linked list algorithm

157 byte By alexsoonera at 2007-10-1 10:25:38
do you have a good algorithm to reverse a linkedlist, that is, the second node points to the first node, the third one points to the second, as so on?

urm... the minimum info. needed to get three 2D arrays from a single string

1048 byte By adamgreen19a at 2007-10-1 10:28:09
Sorry... if there was enough space ot would say..."What is the minimum set of data required to extract three 2D arrays from a single string of values?"In particular when these arrays are designed and used for matracies caluculations.More specificaly when these matrices represnt the connections ...

All possible combinations

835 byte By kasathea at 2007-10-1 10:29:41
Hello,I am trying to write a java method which takes a hashmap as the input. The hashmap looks as follows:Key Value**** ******Q1 V11,V12,V13,V14....V1n (This is a collection)Q2 V21,V22,V23,V24....V2n (This is a collection)....Qm Vm1,Vm2,Vm3,Vm4....Vmn (This is a collection)The method should ...

Binary digits

405 byte By Gorditoa at 2007-10-1 10:30:32
Hi all,I need to transform a list of numbers in binary digits and then I must find the way to analyze each bit, so that "0" gives me something and "1" gives me something else.For example: 6 --> 110. First I analyze "1", then the other "1" and last the "0" in recursive way. I hope I've been ...

combinatorics

557 byte By goresusa at 2007-10-1 10:35:49
HI there,I am trying to write a method that would allow me to test a combination of a given number of variables, to check whether it satisfies some conditions. I have come to a conclusion that, depending on the total number of variables, I will have to write as many for loops each time the # of ...

want to sort HashMap based on Values with duplicate values

672 byte By satish_mscisa at 2007-10-1 10:37:29
Hi. I have a requirement to sort the HashMap based on the values not on the keys. My HashMap contains the values which are duplicates. My program is some thing like this.Map m = new HashMap();m.put ("Gosling", new Integer(2000));m.put ("Joy", new Integer(2000));m.put ("Schwartz", new ...

keyword highlighting

1798 byte By clarkiea at 2007-10-1 10:38:43
i'm trying to write a text editor for any programming language but i'm having a problem with highlighting the keywords. I can highlight the actual keywords easily but i cant stop it highlighting keywords within other words. for example:System.out.println("Hello World"); Not sure how to solve ...

sql algorithm

214 byte By glowiza at 2007-10-1 10:40:27
i'm a newbie in Java programming. I wanted to know how do i write an algorithm for sql in java. Can anyone please help me or provide me with some useful tutorials and link that i can follow thru..Thank you.

Rotation Invariant Image Matching Algorithm

365 byte By Superprada at 2007-10-1 10:42:03
Can anyone give me a clear idea as to how do I perform an Image Matching between a source Image and the target Image(source Image rotated to right or left ) . I mean if i have the exact same Image i get the best match with my current algorithm .But if the Image is rotated how do I get the ...

Finding all unique paths in graph

286 byte By Keisslada at 2007-10-1 10:51:53
can anyone suggest an algorithm to find all unique paths between two nodes?I have already implemented a variation of Dijkstra's shortest path algorithm to find ONE path, i'm just not sure how I can find ALL unique paths..Any help much appreciated.thanks :)

Algorithm for data streams

167 byte By mas1a at 2007-10-1 10:59:10
Hi all,Does anyone have any idea about which algorithm is most appropriate to search for items/events in a data stream of logs? Regards,mas

Distributing Items

1743 byte By hpsmartyza at 2007-10-1 11:00:37
Hi,I am facing a "little" problem and I hope you could help me.I'll try to formulate it clearly.I have a set of items (to be distributed in containers) and I I have define how muchcontainers I need to contain all these items.Each item is characterised by two values that are used to check ...

Kruskal's Algorithm (Maze Solving application)

11374 byte By chhasxa at 2007-10-1 11:04:08
I've been working on generating mazes using a variety of techniques. I have successfully implemented the DFS and Prim's algorithm. I'm currently encountering difficulty implementing Kruskal's algorithm. This is mostly due to my lack of understanding pertaining to union-find algorithms. ...

help on choosing right path planning algorithm

941 byte By joynga at 2007-10-1 11:18:01
hi! is there anyone who could help us in chossing the right path planning algorithm to our project. the project should work this way...but first let me tell you that we have a mobile robot and a number of flowerpots contained in an area which is approximately 5 feet by 5 feet. Prior to the main ...

Permutations

628 byte By Triggerme2icea at 2007-10-1 11:20:41
Hey all mathematicians...I need to figure out a way to print all the possible permutations of a given string in java. I uderstand this would use recursion. I would like the program to use any possible string with any length of string. But even if it would work for only 4 characters consisting ...

Graph Algorithm Research Tool (GART)

383 byte By rkippena at 2007-10-1 11:28:33
In reference to this thread: http://forum.java.sun.com/thread.jspa?forumID=426&threadID=435407around reply 20 I mentioned a Graph API but never gave a URL whereit can be accessed, mainly because it wasn't ready.Well, it has just been released as part of a demo application calledGart Demo, ...

Enumerating all valid subtrees

462 byte By MarkAGreenwooda at 2007-10-1 11:36:17
Hi,Does anyone know of Java code/library that given a tree structure will enumerate all the possible subtrees. Ideally the tree should be represented as a set of linked nodes similary to the way JTrees can be built using DefaultMutableTreeNode. I've tried doing a exhaustive algorithm to get ...

Wavelet Library in Java?

229 byte By Superprada at 2007-10-1 11:37:19
Is there a Wavelet transform libraray for Images in Java. I feel there should be some wavelet class for (Haar, Daub , Fourier and such transforms). If some one could give me pointers that would be great. Thanks in Advance.

Parallel Permutation?

760 byte By NoFaqa at 2007-10-1 11:44:43
Hi Everyone,I was working on a permutation algorithm (don't know if it already exists). The purpose of this algortihm is to be parallel so I can set it up on a grid. Here is the idea:I recieve an string s of a size l. Then, i fragment the string so i create a list of small goups that al ...

Min-Max Algorithm - StackOverFlowError ?

13396 byte By buddyholly83a at 2007-10-1 11:58:59
Having trouble with my minmax algorithm for my game. Keep getting StackOverFlowError - possible due to too much recursion? If it is too much recusion - ie the game tree is too vast what should I do?This is just for a Dominoes game - so I didnt think it would be that complicated :SAny help / ...

Converting/packing a string of 01010101 to a byte

779 byte By patpicosa at 2007-10-1 11:59:39
Hi everyone,-I need to create a function that will take a string of 1's and 0's. -The string length will be from 1 to 8, if the length of the string is below 8, it will add trailing 0's (to make 8 bits)ie. packStrToByte("1011") would return 176 (10110000)I want to pack that string in a byte ...

How can i calculate mode?

194 byte By csci321a at 2007-10-1 12:01:28
Hi everyone :)I want to know how can i calculate statistical figures....namely, mode(frequency) through java...i take values(results) from a vector.....?Can anyone pls help?

a new database explorer project

1067 byte By lDoRiLeOa at 2007-10-1 12:04:26
Hi folks!I've planed to write a new "database explorer" firtly I mean to use this project in my Java Developer Certification Exams, after(or before) I want to open the source and have another database explorer in the open source world. :)My firts ideas are around a different way to implement ...