There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Originally posted by Ernest Friedman-Hill:
2,4,5,9 are a cluster because all these numbers are connected by pairs. 1, 3, 6 likewise (the pairs 3, 1 and 1, 6 connect all these numbers. 39,56 are alone because they're each just mentioned in that one pair together.
Originally posted by Salman Jamali:
Ernest, I'll try your code in a few hours, thanks a lot!
What does that mean?priyanka kusuma wrote: . . . my problem is i am not able to insert the number pair in to another array list if it is not present in the arraylist that is already there
priyanka kusuma wrote:hey i dont know how to ask you people my problem it is not about urgent i am just stuck with this code since 1 week and i dont know where i am doing wrong...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Campbell Ritchie wrote:How are you supposed to turn 4,29 34,4 into 4,29,34? You can’t do anything until you understand that.
priyanka kusuma wrote:hey what i mean is if any pair has common numbers then all those pairs must form in to a group and this is the code i have tried so far...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
priyanka kusuma wrote:Hey Winston as you said i am explaining my problem from first
Actually what i am doing is i have 110 text files now i have to construct a similarity matrix which shows the number of common elements between 2 files
I hope now you have got clear idea of my code
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
priyanka kusuma wrote:Now i think this is completely about my work i am doing. I hope you understand now
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
priyanka kusuma wrote:String line = inputFile.nextLine( );
final String[] array = line.split(" ");
and i am stuck here because in a while loop we can take one number at a time so please help me out here
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
priyanka kusuma wrote:String line = inputFile.nextLine( );
final String[] array = line.split(" ");
and i am stuck here because in a while loop we can take one number at a time so please help me out here
Why would you think that line.split(" ") is going to work if the input uses commas? (at least that's what you've shown us up to now)
And once you have your number String(s), how do you think you convert them to the values you want? I presume you're familiar with the java.lang.Integer and java.lang.Double APIs - and if you're not, you should read them.
You need to ShowSomeEffort priyanka. Nobody here is simply going to hand you code.
Winston
priyanka kusuma wrote:Hey it is because in my input file i dont have "," for you guys to understand i am using ",".
and i am not asking anything without my effort as i have told you earlier i am in the last stage of my project and i need this part and also i have written the code and what i want is you to correct the code where i have written wrong so that i can do it
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
priyanka kusuma wrote:Hey I am sorry for my mistakes and thanks for your suggestions .Now I am asking you clearly could you please tell me how to read two numbers at a time as input from a text file which are separated by a space in each line so that i can compare them with my existing array list and i am having 1200 pairs
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
priyanka kusuma wrote:Hey I am using while loop because it has to stop when it reaches the end of the file...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Ernest Friedman-Hill wrote:
Originally posted by Salman Jamali:
Ernest, I'll try your code in a few hours, thanks a lot!
I've used this algorithm to find contiguous connected surfaces on a 3D polygonal model (my "pairs" are edges, and my "points" are faces.)