Permutation in array

Posted on 2005-03-18
Medium Priority
Last Modified: 2010-05-18
I have an array size n, filled with double values. I want to make some mathematical calculations (queue) and i have to get all posible combinations of elements in array. Something like this:

  for (int i=0; i<array.length;i++) {
       for (int j=0; j<array.length;j++)
                        //here will be my formula which uses all elements in array
     // here should be used permutation of elements

I really don't know how to do permutations. Can someone help me please?
Question by:Premanidhi
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Author Comment

ID: 13572688
sorry my first algorithem was wrong. Take this one:
while all combinations of elements in array are not set {
       for (int j=0; j<array.length;j++)
                        //here will be my formula which uses all elements in array
     // here should be used permutation of elements
LVL 92

Accepted Solution

objects earned 432 total points
ID: 13572705

Expert Comment

ID: 13572741
if u want to use value in array then ,


will return double value from current position of array.

and for permutation visit these links.


Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month12 days, 7 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question