我们如何插入数组 [英] how we do insert in Array

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

问题描述

我们如何在Array中插入,删除和搜索

how we do insert and delete and search in Array

推荐答案

一个数组没有插入"或删除"-您将必须执行这些操作通过上下移动数据(如果分配了足够的空间)或分配更大/更小的数组,然后将相关的数据块复制到适当的位置.

搜索取决于数组的大小,数组的顺序程度以及要使用的算法.
An array does not have "Insert" or "Delete" - you would have to do these either by shuffling data up or down (if you allocated enough space) or by allocating a bigger / smaller array and copying the relevant data chunks over into the appropriate places.

Searching depends on the size of the array, the degree of order in it, and the algorithm you want to use.


这篇关于我们如何插入数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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