文件名称:DArray-better

  • 所属分类:
  • 压缩解压
  • 资源属性:
  • [Windows] [Visual C] [源码]
  • 上传时间:
  • 2012-11-26
  • 文件大小:
  • 286kb
  • 下载次数:
  • 0次
  • 提 供 者:
  • 陈*
  • 相关连接:
  • 下载说明:
  • 别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容均来自于网络,请自行研究使用

当数组的元素个数发生变化时,不用重新申请内存空间,数组也能继续使用。这样就提高了效率。



对于机器算法中,“时间”和“空间”的矛盾总是存在的:存储多一点,运行就快些;存储少了,运行就慢些。在这里就体现了,这样处理是用空间换时间。虽然在内存空间上是“浪费”了部分的空间,但是在很长一段时间里,只要空间没有发生变化,运行的时间复杂度就恒定的。只有当现有的空间不够用时,才发生内存的重新申请和释放操作。最简单的增长方法就是增长一倍,即乘以2,这样内存分配的大小就是2的幂次方。

-When the number of elements in the array change, do not re-apply for the memory space, the array can continue to use. This will improve efficiency.



Algorithm for the machine, the "time" and "space" of the conflict is always there: a little more storage, running on the faster store less, running on more slowly. Embodied in here, this treatment is a space for time. Although the memory space is "wasted" some of the space, but in a very long time, as long as the space has not changed, run on a constant time complexity. Only when existing space is not enough, the only place to re-apply and release the memory operation. The easiest way is to double the growth, that is multiplied by 2, so the size of memory allocation is a power of 2.
(系统自动生成,下载前可以参看下载内容)

下载文件列表

DArray-better\DynamicArray.dsw

.............\DynamicArray.ncb

.............\DynamicArray.plg

.............\DynamicArray.dsp

.............\DArray.h

.............\.ebug\vc60.idb

.............\.....\vc60.pdb

.............\.....\DynamicArray.exe

.............\.....\DynamicArray.pdb

.............\.....\DynamicArray.ilk

.............\.....\DynamicArray.pch

.............\.....\main.obj

.............\.....\DArray.obj

.............\main.cpp

.............\DArray.cpp

.............\DynamicArray.opt

.............\Debug

DArray-better

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org