Php Data Structure Problems

Source: Internet
Author: User
First: 3 elements; Second: 2 elements; Third: How do two elements generate a format like {code? The number of types and the number of elements of each type can be changed. For example, the first type is 2 elements. The second type is 1 element. The third type is 2 elements. The fourth type is 2 elements: the three elements become {code... first: Three Elements
2: 2 Elements
Third: two elements

How to generate

0-0-00-0-10-1-00-1-11-0-01-0-11-1-01-1-12-0-02-0-12-1-02-1-1

What about this format?

The number of types and the number of elements of each type are variable, such

First: two elements
Type 2: 1 Element
Third: two elements
Fourth: Three Elements

It becomes

0-0-0-0....2-0-1-2

What about this format?

Reply content:

First: Three Elements
2: 2 Elements
Third: two elements

How to generate

0-0-00-0-10-1-00-1-11-0-01-0-11-1-01-1-12-0-02-0-12-1-02-1-1

What about this format?

The number of types and the number of elements of each type are variable, such

First: two elements
Type 2: 1 Element
Third: two elements
Fourth: Three Elements

It becomes

0-0-0-0....2-0-1-2

What about this format?

Isn't this a normal remainder? Just an ordinary array. You can use an auto-incrementing integer to repeatedly retrieve the remainder to list all the combinations.

Http://3v4l.org/rnOU4

php
  = 1) {            break;        } else {            $results[] = $result;            $i++;        }    }    return $results;}

The business environment is not clear ~ What are you talking about ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.