- 1、本文档共107页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Chapter 4 Unordered Lista
* * * * 根据元素值,确定其第一次出现的位置, 此函数放在这里,是因为接下来delete方法要调用 * 根据元素值删除 首先调用indexOf定位,然后调用removeat根据位置删除 * 根据位置删除 重要方法 分成A(删除0号元素),B(删除其它位置的元素)两种情况 * * * * * * 如何存储?? Arraylist的内容可参考 /view/5842d9d076eeaeaad1f330c7.html * 第一次课未讲,顺序表与链表比较 * * * * * * * * * * * * * * * * * 9.9日看到这里 * * * * * * * * * * * * * * * * 如果数据按照查询概率大小递减排序,则平均的比较次数最少。 重排数据。 * * C++ 中的模板类 Java中称为泛类型 从这里看出,List应该被定义为一个泛类型 List使用举例,假设已实现有这样的List类 * * * * * 垃圾回收器的finalize方法什么时候执行? 在程序运行后执行,具体什么时候执行是由JVM控制 垃圾回收时回收器先暂停程序的运行,然后将所有存活的对象从当前堆复制到另一个堆,没有被复制的全是垃圾清理掉 还有种方法是 从堆栈和静态存储区出发,遍历所有的引用,进而找出所有存活的对象。每当它找到一个存活对象,就会给对象一个标记,全部标记完成时,没有标记的对象将被释放 finalize相当于C++的析构函数,他是垃圾回收器回收对象时第一个要调用的方法 。 跳转至List的实现,第50页 * 一个ExpenseList类将支持一些支出维护的操作。 1、使用通用的List类作为类的一个属性,重用List类的一个或多个方法,从而实现ExpenseList类的对象。 2、每个消费条目将会包含支出金额,消费日期和消费项目。 * * * ? final成员变量表示常量,只能被赋值一次,赋值后值不再改变。? 被static修饰的成员变量和成员方法独立于该类的任何对象。也就是说,它不依赖类特定的实例,被类的所有实例共享。只要这个类被加载,Java虚拟机就能根据类名在运行时数据区的方法区内定找到他们。因此,static对象可以在它的任何对象创建之前访问,无需引用任何对象。 * * * * * * * * 此get方法我已经做过修改,getExp.equals(exp),书上有错 * * * * * * * 4.6 A LinkedList class Update method 4.6 A LinkedList class Access methods Index?Item 4.6 A LinkedList class get is identical in logic to the indexOf method except that it returns the matching item if found. 4.7 List Class Implementation Review Started with the List interface, using it to build an ExpenseList class. To implement the List class use an array or the java.util.ArrayList class would not be a good choice. The LinkedList class, on the other hand would be ideal. The ExpenseList class implementation uses the List class as a component, the List class is built using the LinkedList class as a compenent. 4.7 List Class Implementation 4.7 List Class Implementation 4.8 Summary The unordered list is a linear collection of entries whose relative positions with respect to each other is irrelevant. The unordered list is characterized by four main operations: Append Remove Enumerate Search 4.8 Summary An entry is searched for in a unordered list using sequential
您可能关注的文档
- Anycast m2 plus无线推送器的详细使用说明.doc
- Art-_Discovering_Useful_Structures_课件(选修六_unit_1).ppt
- Asking Better Questions2012.10.15.ppt
- Atheros_Calibration_简介.ppt
- auto industry-country risks.ppt
- Audrey Hepburn second-version.pptx
- Away from the World - a story of a 6-year old boy with AIDS.ppt
- Autumn in the country.ppt
- AvayaERS3500ProductPitchPackv1.pptx
- A_Night_the_Earth_didn’t_Sleep1.ppt
- Chapter2-PhysicalLayer3.pptx
- chapter2-physical layer.ppt
- chapter3 AA and primary structure of protein(part 1).ppt
- Chapter5 The Eighteenth Century.ppt
- Chapter_2_-_Measuring_Benchmarking_Warehouse_Performance.ppt
- Chap_24Measuring the Cost of Living.ppt
- Chapter_7 ppt.ppt
- chatper 5 investment.ppt
- chatper two.ppt
- Chinaseppe Company Introduction中国公司介绍PPT.ppt
文档评论(0)