There are a collection of objects, each object has it properties and a list of objects that depens of. So I want to generate a Directly Acyclic Graph, that can model the dependency of every object. Also mutual conection doesn't exists, so object A depends object B, so object B can't depends object A, thats a rule that must follow every object, if happens then object A and object B automatically get merge in object C, so A+B=C. There is an algorithm for this situation? ]]>

I have to specify how many times will be compared the two array elements in Bubble sort.

Code:

`Array[1,...n]`

1. for i=1 to n-1

2. do for j=1 to n-i

3. do if A[j]>A[j+1]

4. then swap A[j] with A[j+1]

It depends how many data we have(array length), how much it is not sorted, how big data is e.g. -1000 to 1000.Is not it?

What I have done?

I simulated this situation in Java.

1000 times I filled the array with (random.nextInt) data 0 to 9, -9 to 9, 0 to 99, -99 to 99 to 10 and 100 array length.

I simulated 10 times each situation.

Results:

Data Average compare

0 to 9 20

-9 to 9 21

0 to 99 22

-99 to 99 22

Data Average compare

0 to 9 2203

-9 to 9 2342

0 to 99 2452

-99 to 99 2461

So when the array length is 10 average=(near)length*2 but when array length is 100 average=(near)length*2,3

Should it help me or this information is worthless? ]]>

I'm looking for an algorithm to track the numbers at least duplicate content in a two-dimensional array to draw complex objects composed of rectangles, squares, triangles, hexagons, etc.

The constraints are:

- I require at least how many numbers should not be duplicated

- The vertices of the objects must contain at least duplicate numbers except those required

- Objects should be placed symmetrically

An example below:

In the drawing you see duplicate values 0,10,15,18,19,25 *, 35,45,50 and the three individual numbers. * 25 is shared between two objects

The numbers 16,27,46 are the three numbers that I requested unduplicated

Course can be traced different combinations of objects that match the given condition.

I am looking for a fast algorithm. I have processing times biblical!

Thank you in advance

If you had a target of timeflieslikeanarrow and a staring string of tfemiliilzejeworrbna, you would have the following operations for a minimum of 6.

tfemiliilzejeworrbna (the target)

tfemiliilzejeanbrrow (transpose)

tfemiliezlijeanbrrow (transpose)

timefliezlijeanbrrow (transpose)

timefliezlijeanarrow (a substitution)

timefliezlikeanarrow (a substitution)

timeflieslikeanarrow (a substitution) ]]>

Anticipated Return Level | Probability |

25% | 5% |

15% | 20% |

10% | 25% |

less than 10% | 50% |

You are not allowed to invest in projects anticipated to have less than a 10% return. There is a penalty for failing to invest in at least 13 projects. The penalty is a 3% decrement to your average return for each project less than 13. You find yourself in month 32 committed to 10 of the 31 projects that you have already reviewed and with an average anticipated return of 13% and you anticipate that this 32 nd

project will have a 10% return