一维数组中的重定位 [英] relocation in 1D array

查看:80
本文介绍了一维数组中的重定位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,朋友们!我想知道如何将数组的元素移动到同一数组中的另一个地址.假设数组具有类似[1 2 3 4]的元素.预期的o/p为[4 1 2 3].无需进行交换,我们只能使用单个阵列.我们无法在其他数组或类似的数组中复制一些元素.
无法获得解决方案.请给出一些建议.

Hello frnds! I want to know how to move an element of an array to another address within the same array. Suppose the array has elements like [1 2 3 4]. The expected o/p is [4 1 2 3]. No swapping is to be done & we hav to work with only a single array. We cant copy few elements in some other array or anything like that.
Unable to get solution. Pls give some suggestions.

推荐答案

在给定约束(无法交换)的情况下,没有通用的解决方案.
There is no general solution to your problem, given the constraints (cannot swap).


这篇关于一维数组中的重定位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆