array find all possible dimension

array find all possible dimension

Given array: int[] dimension = { 1, 2, 3 };

That produces the output: 1 2 3 12 13 23 123

I'm new to array...i can't figure out the way on even how to start... any idea?...really appreaciate if someone could help...thanks!

View Answers

March 11, 2011 at 3:26 PM

import java.util.*;

class Example{
static ArrayList list = new ArrayList();
    public static void generate(String str){
        list.add(str);

        if (str.length() == 1){
            list.add(str);
            return;
        }
        for (int i = 0; i < str.length(); i++){
            generate(str.substring(0,i) + str.substring(i+1));
        }
    }
    public static void main(String args[])
    {
        int arr[]={1,2,3};
        String st ="";
        for(int i=0;i<arr.length;i++){
            st+=Integer.toString(arr[i]);
        }

        generate(st);
        HashSet set=new HashSet(list);
        ArrayList l=new ArrayList(set);
        for(int i=l.size()-1;i>=0;i--){
        System.out.println(l.get(i));
        }
    }
}









Related Tutorials/Questions & Answers:
array find all possible dimension
array find all possible dimension  Given array: int[] dimension = { 1, 2, 3 }; That produces the output: 1 2 3 12 13 23 123 I'm new to array...i can't figure out the way on even how to start... any idea?...really appreaciate
how to find subarray from given large 2d array of arbritary dimension
how to find subarray from given large 2d array of arbritary dimension  my code is: import java.lang.*; import java.io.*; import java.io.File; import... to print the subarray of any dimension from given array file. i have tried upto
Advertisements
I want to know the all possible syntax for EL code to print the first element of an array.
I want to know the all possible syntax for EL code to print the first element of an array.  Which is the correct EL codes syntax to print the first element of an array named employeeArray. ${employeeArray["0"]} or ${employeeArray
JavaScript array dimension
JavaScript array dimension       In this code we help you to understand array dimension... to make a Two dimension array. The page on loading invoke a function display
javascript:getElementByClassname:Is it possible to collect all the elements with same classname
javascript:getElementByClassname:Is it possible to collect all the elements with same classname  Is it possible to collect all the elements with same classname in a array n display the array by using getElementByClassname
Find out last character of array
Find out last character of array  How we can find out the last character of array in java program
Find position of an array element
Find position of an array element In this section, you will learn how to find the index of an array element. For this, we have allowed the user to enter the array elements of their choice and also the number whose index value
how to print all possible combination that sum to zero??
how to print all possible combination that sum to zero??  Ã?Â.... Print all possible combinations that sum to zero Example Enter a num : 7 1... each of the digits so that the resultant sum is zero. Print all posible
it possible or not
it possible or not  without public static void main(string args[]) in java program it is possible
Find a missing element from array
Find a missing element from array We have two arrays A and B where B consists of all the elements that are present in A but one element is missing from the array B. From these two arrays, we have to find the missing element from
To find first two maximum numbers in an array
To find first two maximum numbers in an array  Java program to find first two maximum numbers in an array,using single loop without sorting array
USE ARRAY TO FIND THE LARGEST NUMBER AND OCCURRENCE
USE ARRAY TO FIND THE LARGEST NUMBER AND OCCURRENCE  i have some exercise from my lecturer and I still can't understand about ARRAY. here it is: write a program that reads 10 numbers from the keyboard. find the largest number
Itried all possible ways still getting thesame error
Itried all possible ways still getting thesame error  java.sql.SQLException: Io exception: Got minus one from a read call at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112
Find Second Largest Number from an Array
Find Second Largest Number from an Array This section illustrates you how to find the second largest number from an array. For this purpose, we have allowed the user to enter the array elements of their choice and determine the largest
array accept all data type
array accept all data type  how can create array that accept all data type??? if we can solution it? how..   Hi Friend, Try the following code: import java.lang.reflect.*; class CreateArrayOfAllTypes{ public
array accept all data type
array accept all data type  how can create array that accept all data type??? if we can solution it? how..   Hi Friend, Try the following code: import java.lang.reflect.*; class CreateArrayOfAllTypes{ public
To find first two maximum numbers in an array,using single loop without sorting array.
To find first two maximum numbers in an array,using single loop without sorting array.  Java program to find first two maximum numbers in an array,using single loop without sorting array
To find first two maximum numbers in an array,using single loop without sorting array.
To find first two maximum numbers in an array,using single loop without sorting array.  Java program to find first two maximum numbers in an array,using single loop without sorting array
Find sum of all the elements of matrix using Java
Find sum of all the elements of matrix using Java A matrix is a rectangular array of numbers. The numbers in the matrix are called its entries or its elements... dimensional array. Now to determine the sum of all these elements, we have
Find Array element from index using GUI
Find Array element from index using GUI In this tutorial, you will learn how to create an GUI application to find an array element from its index. For this, we have created an an array of 100 randomly chosen integers and allow
sql php array
sql php array       SQL PHP Array support simple dimension array. The SQL PHP Array is used to populate array from MySQL database. Understand with Example ADS_TO_REPLACE_1
how to find inverse of n*n 2d array in java
how to find inverse of n*n 2d array in java  I reached upto code of printing the matrix as: Assume that matrix is square matrix where row=column code is: public class ReadContents{ public static void main(String args
find all unique character in string using java
find all unique character in string using java  example: hello how are you. output should be waryu
How to find list of all index in Neo4j?
How to find list of all index in Neo4j?  Hi, I have database in Neo4j and I want to find the list of all the indexes in it. How to get the list of all indexes in Neo4j database? Thanks   Hi, Login to Node4j admin
cannot find symbol class array queue--plzz somebody help..
cannot find symbol class array queue--plzz somebody help..  import java.util.*; public class Test { public static void main(String[] args) { ArrayQueue<String> q = new ArrayQueue<String>(6); System.out.println
Array
Array  is it possible to define array like this..? int[] intArray = new int[] {4,5,6,7,8}; Explain...?   Yes, you can. Java Initialize Array
Two - dimension arraylist
Two - dimension arraylist  how to create two - dimension arraylist in jsp-servlet
please please i wanna insertion sort program find calendar to array value (1000,5000,10000), please help me
Insertion sort program find calendar to array value 1000,5000,10000  program find calendar for insertion sort in jfram to array 1000
How to Print Array in JavaScript
How to Print Array in JavaScript In this section you will learn about Array in JavaScript. Array are important part of all programming languages. Array in JavaScript is a variable that can hold more than one value. Array is a collection
Find sum of the squares of Array elements
Find sum of the squares of Array elements In this section, you will learn how to compute the sum of the squares of the array elements. For this, we have allowed the user to enter 5 numbers, to be stored into the array. Then we have
Find in Array - Calculate Occurrences of Elements in Array
Find in Array - Calculate Occurrences of Elements in Array... to calculate occurrences of elements in an array. Occurrences means, the how many times an element occurs in the array. In this section, you will get more and more
Array Name
Array Name  How To Set Value in Two-Dimension ArrayList
write a java program to find the summation of all the integers entered on command line
write a java program to find the summation of all the integers entered on command line  Hi, write a java program to find the summation of all the integers entered on command line? How to write Java program for summation of all
JavaScript array position
JavaScript array position       In this section of JavaScript array tutorial we have to find... by which we can find the position of the array item therefore we have created
Is it possible in SWT ?
Is it possible in SWT ?  I want drop down like google search (ie, when we type one letter then the word start with that are displayed). when the drop down list appear, then we can select one of word as our text box value. Can i
Finding an Element in a Sorted Array
. In this section, you will learn how to sort an array and how to find a text in the sorted...: Arrays.sort(names): Above method sorts all the elements present in the array... Finding an Element in a Sorted Array   
array
array  WAP in java to store 6 element in array P and 4 element in array Q. Produce the third arra y R containing all element from p & q
in_array
in_array  in_array in php
is _array()
is _array()  is_array() in php   Hi Friend, This function is of Boolean type.It checks whether a variable is an array or not. Here is an example: <?php $yes = array('Hello', 'World'); echo is_array($yes) ? 'Array
is _array()
is _array()  is _array()   Hi Friend, This function is of Boolean type.It checks whether a variable is an array or not. Here is an example: <?php $yes = array('Hello', 'World'); echo is_array($yes) ? 'Array
c++ array find the average mark, highest mark, lowest mark, number of students passing,
c++ array find the average mark, highest mark, lowest mark, number of students passing,    i need help in adding the c++ code for the average mark, highest mark, lowest mark, number of students passing, using array. 01
c++ array find the average mark, highest mark, lowest mark, number of students passing,
c++ array find the average mark, highest mark, lowest mark, number of students passing,    i need help in adding the c++ code for the average mark, highest mark, lowest mark, number of students passing, using array. 01
array
array  take a 2d array and display all its elements in a matrix fome using only one for loop and ple explain the program in below
array
is an example that store some integers into an array and find the occurrence of each number from the array. import java.util.*; public class SearchNumberOccurrence...array  Hi i have array like {1,2,3,4,,5,5,6,6} then how can i
Array
Array  how can i use elements of an array in a circular form? that is if the searching of the element reach the last elements of the array, then it will start serching from the begining of the array
Array
Array  What if i will not declare the limit index of an array, how will I declare an array and store values with it using loop?   Hi Friend... Scanner(System.in); int array[]=new int[5]; System.out.println("Enter
array
array  write and test a function named mirror that is passed an array of n floats and returns a newly created array that contains those n floats... the array {10.1,11.2,8.3,7.5,22} into{22,7.5,8.3,11.2,10.1
array
array  write and test a function named mirror that is passed an array of n floats and returns a newly created array that contains those n floats... the array {10.1,11.2,8.3,7.5,22} into{22,7.5,8.3,11.2,10.1
array
array  write and test a function named mirror that is passed an array of n floats and returns a newly created array that contains those n floats... the array {10.1,11.2,8.3,7.5,22} into{22,7.5,8.3,11.2,10.1
Array
Array  How do i insert elements into an array up to a limit from...("Enter Range: "); int size=input.nextInt(); int array[]=new int[size]; System.out.println("Enter Array Elements: "); for(int i=0;i<

Ads