Hi guys,
ive never visit this forum..this is my 1st time here...i think this is the most suitable forum to my problem.all peoples here is talented about algorithm.
want to discuss with u guys and begging your opinion or suggestion to solve my problem.

i have this input
input[0]={0,1,2,3}
input[1]={0,1,2}
input[2]={0,1,2,3}
input[3]={0,1}

value=2,3
and when value=3,binary
binary[0]={0,1,1,1}
binary[1]={1,0,1,1}
binary[2]={1,1,0,1}
binary[3]={1,1,1,0}

and when value=2,binary
binary[0]={0,0,1,1}
binary[1]={0,1,1,0}
binary[2]={1,1,0,0}
binary[3]={1,0,0,1}


if user choose value=2,result should b like this:
(i take example for binary[0]={0,1,1})

result[0]={x,x,0,0}
result[1]={x,x,0,1}
result[2]={x,x,1,0}
result[3]={x,x,1,1}
result[4]={x,x,2,0}
result[5]={x,x,2,1}
result[6]={x,x,3,0}
result[7]={x,x,3,1}

as u can see,binary[0][0]=0, 'x' take d place.
if binary[0][1] and binary[0][2]=1,
input[2]={0,1,2,3} and input[3]={0,1} take the place alternately.
binary[0][2]=input[3]
binary[0][1]=input[2]

Binary[a]: b is refer to the address of input.
so if binary[0][2] means refer to input[2].
the conclusion is:
result[0]={x,x,input[2][0],input[3][0]}
result[1]={x,x,input[2][0],input[3][1]}
result[2]={x,x,input[2][1],input[3][0]}
result[3]={x,x,input[2][1],input[3][1]}
result[4]={x,x,input[2][2],input[3][0]}
result[5]={x,x,input[2][2],input[3][1]}
result[6]={x,x,input[2][3],input[3][0]}
result[7]={x,x,input[2][3],input[3][1]}

same thing with binary[1],[2] and so on.

i have no problem if value=2,but if value=3 and value could be more than 3 too cause problem to me.if value=2, i can use for loop but my value should be more than 3 depend on user.

fuh!!!
any suggestion guys???

Your description of problem is too fuzzy. At first try to abstract from details and tell us in general - What are you trying to achieve here ?

This is what I have understood so far.... When the value is 2 you are doing right circular shift and when the value is 3 you are doing left circular shift. You have some input
How do you determine which values come into the result array ?

Its actually like this:

User key in input like this:
input[0]={0,1,2,3}
input[1]={0,1,2}
input[2]={0,1,2,3}
input[3]={0,1}

User have to choose the generator either 2,3,4,5 or 6.
But, in this example user only can choose either 2 or 3 because the input only 4 input [0] to input[3].
(example 1)if user choose 3: Binary setting will be generated like this:
binary[0]={0,1,1,1}
binary[1]={1,0,1,1}
binary[2]={1,1,0,1}
binary[3]={1,1,1,0}

(Example 2)if user choose generator=2,binary setting will be like this:
binary[0]={0,0,1,1}
binary[1]={0,1,1,0}
binary[2]={1,1,0,0}
binary[3]={1,0,0,1}

* Note:Binary setting generator is successfully coded and its not my real problem.

if user choose generator=2,result should b like this:
(This is the result for binary[0]={0,0,1,1})

result[0]={x,x,0,0} //'x' will be located where the binary=0.this case binary[0][0&1]
result[1]={x,x,0,1}
result[2]={x,x,1,0}
result[3]={x,x,1,1}
result[4]={x,x,2,0}
result[5]={x,x,2,1}
result[6]={x,x,3,0}
result[7]={x,x,3,1}

for binary='1',its generate the result from input which is same address with binary.for this case binary[0][2] and binary[0][3]. so related input is input[2] and input[3].
input[2]={0,1,2,3} and input[3]={0,1} take the place alternately.
binary[0][3]=input[3]
binary[0][2]=input[2]


the conclusion for binary[0] is:
result[0]={x,x,input[2][0],input[3][0]}
result[1]={x,x,input[2][0],input[3][1]}
result[2]={x,x,input[2][1],input[3][0]}
result[3]={x,x,input[2][1],input[3][1]}
result[4]={x,x,input[2][2],input[3][0]}
result[5]={x,x,input[2][2],input[3][1]}
result[6]={x,x,input[2][3],input[3][0]}
result[7]={x,x,input[2][3],input[3][1]}

for binary[1]={0,1,1,0}

the conclusion for binary[0] is:
result[0]={x,input[1][0],input[2][0],x}
result[0]={x,input[1][0],input[2][1],x}
result[0]={x,input[1][0],input[2][2],x}
result[0]={x,input[1][0],input[2][3],x}
result[0]={x,input[1][1],input[2][0],x}
result[0]={x,input[1][1],input[2][1],x}
result[0]={x,input[1][1],input[2][2],x}
result[0]={x,input[1][1],input[2][3],x}
result[0]={x,input[1][2],input[2][0],x}
result[0]={x,input[1][2],input[2][1],x}
result[0]={x,input[1][2],input[2][2],x}
result[0]={x,input[1][2],input[2][3],x}

i have the algorithm for generator=2,but my algorithm is not relevant for generator=3,4,5 or 6.
The difference between generator=2,3,4,5 and 6 is binary setting.

Seems you totally don't want help from us. If you really want - show us info in the form:

-------------------------------------
Algorithm_INPUTS | Algorithm_OUTPUTS |
-------------------------------------
|                |                   |
|                |                   |

By having such data we could help to you. Also you could try to show your current algorithm. It can be that we will acquire more info about problem from your current algorithm than from your current explanations.

Seems you totally don't want help from us. If you really want - show us info in the form:

-------------------------------------
Algorithm_INPUTS | Algorithm_OUTPUTS |
-------------------------------------
|                |                   |
|                |                   |

By having such data we could help to you. Also you could try to show your current algorithm. It can be that we will acquire more info about problem from your current algorithm than from your current explanations.

Its not what i meant...its just i dont know how to describe my problem here. thanks for giving me the idea.i hope this is what u want from me.

for rite now, i have algorithm for generator=2.i use for loop.

for(Iterator it=binary.iterator();it.hasNext();)//binary list row by row
 for (i=0;i<input length;i++)
  for(j=0;j<input length;j++)
     {   layer=0
          for (z=0;z<lenght;x++)
            {  check if binary='1'
                        yes check if layer==1
                                    yes result[z]=i;
                                    no if layer==2
                                         yes result[z]=j;
                                  layer++
                        no means binary='0'
                          result[z]='x'
             }

i hope u guys understand this.but this algorithm is not suitable for generator=3,4,5,6.
Thats y im looking for the new algorithm which can do the same and relevant for bigger generator.

As far as i understood you want to map generator,input and binary setting to output ? Representation of your problem is incomplete/unclear. For that reasons please fill FULL table, something like:

--------------------------------------------
Input | Binary setting | Generator | OUTPUT |
--------------------------------------------
|     |                |           |        |

If we have such full table maybe we could decode meaning of "generator" and "input" and to see in general what your algorithm should output within the given conditions.

As far as i understood you want to map generator,input and binary setting to output ? Representation of your problem is incomplete/unclear. For that reasons please fill FULL table, something like:

--------------------------------------------
Input | Binary setting | Generator | OUTPUT |
--------------------------------------------
|     |                |           |        |

If we have such full table maybe we could decode meaning of "generator" and "input" and to see in general what your algorithm should output within the given conditions.

i hope this can make u clear

Anyone have an idea?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.