[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Please send email if you are having login problems - see the posts below for more info.
Hotmail and Yahoo! users - please see the Hotmail post or the Yahoo! post for information on lost emails.
Messages posted by: sara12345
Forum Index » Profile for sara12345 » Messages posted by sara12345
Author Message


the code shown above
thanks
hello
I'm facing error "stack over flow" when obtaining results of recursion fuction
I have tested the recursion fuction on medium data size and it works fine and the results are correct but for large data it prints some of the results then an error said "stackOverflowError" is occurd

I need to complete the results of this large data is there is away to do that

thanks alot
hello
I need to write data to array of files but I have an error


can you tell me what is the problem with the array of files

thanks
Hello
I want to implement greedy algorithm for solving travelling salesman problem and really I face problem in implementing this in java I want to find all suboptimal solutions I mean if two cities(a, b) have the same distance the first suboptimal must take city a and from city a taking the next near city and the second optimal solution is taking city b and then taking near city to b and so on

I have tried for about 3 days and I really feel upset
I have made the solution that just take one solution and ignore the remaining but really I want to find all optimal solutions

I really need your advice how to do it

thanks alot
hello everyone
-I have problem in finding all possible solutions for reordering of vector.

-I have vector named (vect_temp) and I want to find all possible reordering of this vector.

-I have function named Min_diff(vect_temp,next_point) works as follows : I should gave it an element (next_point) in the vector (vect_temp) and it must generate the vector (vect_diff) that contains all possible elements next elements.

-The function nex_min(vect_temp,next_point) works as follows : I should gave it an element (next_point) in the vector (vect_temp) and it must generate the vector (vect_min) that contains all possible elements next elements.

-reordering critriea:
-Min_diff(vect_temp,next_point) and nex_min(vect_temp,next_point) and (next_point) in this first iteration is equal to any selected element in the (vect_temp). after calling the functions, if element in the (vect_diff) is equal to the element in ( vect_min) then add this element into the ordered set [ vec_ordering] and call functions Min_diff(vect_temp,next_point) and nex_min(vect_temp,next_point) again , next_point now is the equal to the element that we have been added in the previous step into the ordered set [ vec_ordering] and repeat this process until all elements in (vect_temp) are ordered according to this criteria.

- I'm able to do reordering according to the cirtira above and find one solution. but the problem is that if (vect_diff) contains many elements that equal to many elements in ( vect_min), in this case I need to do reordering for the first equal element and this will be one solution and then find reordering for the next equal element and so on.

let's consider this example:
- let (vect_temp) contains element [5,9,7,3,1]
- for the firs iteration let the next_point equal to 7
- after calling function Min_diff(vect_temp,next_point), then (vect_diff) will contain [ 5,9,3]
- after calling function nex_min(vect_temp,next_point), then ( vect_min) will contain [ 5,9]
so for now (vect_diff) and ( vect_min) will have two equal elements.
- the first solution must be that fist take the first equal element and do reordering such that ordered set [ vec_ordering] will equal to [7,5] then call functions Min_diff(vect_temp,next_point), and nex_min(vect_temp,next_point) again. the( next_point) in this iteration is qual to 5, these funtions will find next elements, let's consider that (vect_diff) and ( vect_min) will have equal element [3] then add this element to the ordered set [ vec_ordering] and repeat calling functions util all elments in (vect_temp) are added to the ordered set [ vec_ordering]. This will be one solution. now the second solution will be is to take second equal elment [9] instead of [5] and continue calling functions and finding ordered list.
so that each time vect_diff and vect_min will have many equal elements, then do reordering for first equal element this is one solution and then do reordering for the second equal element and so on.

-my code that can only find one solution that takes only first equal element in (vect_diff) and ( vect_min) and continue ordering is below

I hope that someone can answer me how to find all posssible reordering set it is urgent pleasssssse






thanks alot that's work fine
thanks for the code but I need to use it for a vector I have change the code as the following:

but after this change I have noticed that it appends all elements of vector together
for example if the vector [1,2,3] I have got 123,321........
can you tell me what is wrong please
thanks

hello
I need to find all possible order of a set of vector I mean if I have the following:
0
1
2
all posssible would be:
0 1 2, 1 0 2, 2 1 0, 1 2 0, 2 0 1, 0 2 1

I have tried to use the swap but I didn't get all possible set
I have used the following code:

Code:
for( int x=0;x<vector.size();x++) {
for ( int w=0;w< vector.size();w++){
Collections.swap(vector, x, w);}}

as I said before the swap method didn't provide me the result I want
can somebody tell me how to do it please urgent
ok if you mean that how can I run my c code in command prompt
I have run it like that
c:\Users\sara\Desktop\sara\sara\cpp.exe
ok I'm just compile the c code using visual c++ 6.0 and after I have compile it, the exe file will be saved somewhere and just in java code Ihave to call c code in that path??
is this what you mean??
ok now no error but still the command line doesnt' appear I have warning said the ( returnValue) is never read!
when I put the command you gave it to me in the main method an error message said "Un handleled exeption type" should I put it somewhere else

thanks
sorry that's because the code you gave it to me very long! so where should I call the c code I mean if the c code named cp1.c where should I call it in java code??
thanks and sorry for these questions
ok thanks alot the errors are removed
but where should I call the exe file should I use the code below:
ok I don't have 1.6 compiler compliance I only have 1.3, 1.4 ,5 ,6 ???
 
Forum Index » Profile for sara12345 » Messages posted by sara12345
Go to:   
Powered by JForum 2.1.9 © JForum Team
This site run by Scott Dunbar of Xigole Systems. © 2005-2011 - Scott Dunbar
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners
hotjoe.com, xigole.com, and Scott Dunbar have no affiliation with Oracle