avatar
1D to 2D conversion problem# Programming - 葵花宝典
j*k
1
Suppose there is a 1D array, we need convert it into a 2D array. Here is the
conditions/requirements:
Already known about 1D array:
1: 1D array can have any number of elements.
2: 1D array can be padded.
Requirements:
1: The 1D array needs least padding.
2: After the conversion, the number of rows of the 2D array should be as
close to the number of columns as possible.
3: The number of rows / the number of columns needs to be even. It's best to
be a power of 2.
Any idea?
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。