
数据结构
文章平均质量分 77
zybzmhhj
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
自己做的数据结构与算法分析(英文3版,weiss写的)的一些课后题
从第三章才开始做题,自己还是有些浮躁,以后看完要把会作的都做完再看下一章。练习3.1You are given a list, L, and another list P, containing integers sorted in ascending order. The operation printLots(L,P) will print the elements in L that a原创 2007-03-02 21:45:00 · 1963 阅读 · 0 评论 -
数据结构与算法分析课后习题第四章(3)
4.38 The larger binary trees in this chapter were generated automatically by a program. This was done by assigning an (x,y) coordinate to each tree node, drawing a circle around each coordinate (this原创 2007-03-29 15:45:00 · 1275 阅读 · 0 评论 -
数据结构与算法分析课后习题第四章(4)
4.40 Write a routine to list out the nodes of a binary tree in level-order. List the root, then nodes at depth 1, followed by nodes at depth 2, and so on.4.44 Write a procedure to traverse a tree st原创 2007-03-29 15:59:00 · 4370 阅读 · 0 评论 -
数据结构与算法分析课后习题第四章(2)
4.16 Redo the binary search tree class to implement lazy deletion. Note carefully that this affects all of the routines. Especially challenging are findMin and findMax, which must now be done recursiv原创 2007-03-16 17:05:00 · 2362 阅读 · 0 评论 -
数据结构与算法分析课后习题第四章(1)
4.11 Write an implementation of the set class, with associated iterators using a binary search tree. Add to each node a link to the parent node.4.12 Write an implementation of the map class by stori原创 2007-03-16 16:53:00 · 1776 阅读 · 0 评论 -
数据结构与算法分析课后习题第三章(11)
3.31 Efficiently implement a stack class using a singly linked list, with no header or tail nodes.3.32 Efficiently implement a queue class using a singly linked list, with no header or tail nodes.原创 2007-03-13 17:10:00 · 2074 阅读 · 0 评论 -
数据结构与算法分析课后习题第三章(10)
3.29 Write an algorithm for printing a singly linked list in reverse, using only constant extra space.This instruction implies that you cannot use recursion but you may assume that your algorithm is a原创 2007-03-13 16:55:00 · 2652 阅读 · 0 评论 -
数据结构与算法分析课后习题第三章(5)
3.7 Modify the Vector class to add bounds checks for indexing.3.8 Add insert and erase to the Vector class.3.10 Modify the Vector class to provide stringent iterator checking by making iterator cl原创 2007-03-05 16:58:00 · 1213 阅读 · 0 评论 -
数据结构与算法分析课后习题第三章(8)
3.24 Write routines to implement two stacks using only one array. Your stack routines should not declare an overflow unless every slot in the array is used3.25 Propose a data structure that supports原创 2007-03-07 17:32:00 · 1732 阅读 · 0 评论 -
数据结构与算法分析课后习题第三章(9)
3.26 Show how to implement three stacks in one array.3.28 A deque is a data structrue consisting of a list of items, on which the following operations are possible:push(x): Insert item x on the fr原创 2007-03-07 17:40:00 · 1142 阅读 · 0 评论 -
数据结构与算法分析课后习题第三章(7)
3.19 Rewrite the List class without using header an tail nodes and describe the differences between the class and the class provided in Section 3.53.21 Write a program to check for balancing symbols原创 2007-03-06 18:33:00 · 1932 阅读 · 0 评论 -
数据结构与算法分析课后习题第三章(6)
Exercise 3.13 Add support for operator-- to the List iterator classes3.14 Looking ahead in an STL iterator requires an application of operator++, which in turn advances the iterator. In some cases l原创 2007-03-06 18:20:00 · 1306 阅读 · 1 评论 -
数据结构与算法分析课后习题第三章(4)
exercise 3.6 The Josephus problem is the following game: N people, numbered 1 to N, are sitting in a circle. Starting at person 1, a hot potato is passed. After M passes, the person holding the hot po原创 2007-03-05 16:25:00 · 1230 阅读 · 0 评论 -
数据结构与算法分析课后习题第三章(3)
Exercises 3.3 Implement the STL find routine that returns the iterator containing the first occurrence of x in the range that begins at start and extends up to but not include end. If x is not found,原创 2007-03-02 21:58:00 · 1987 阅读 · 1 评论 -
数据结构与算法分析课后习题第三章(2)
希望大家看过后对我自己写的这些笨方法提出意见,如果有问题也请及时指出,谢谢^^Exercise 3.2 Swap two adjacent elements by adjusting only the links ( and not the data ) usinga. Singly linked list.b. Doubly linked list //single.hpp#原创 2007-03-02 21:54:00 · 3415 阅读 · 1 评论 -
数据结构与算法分析课后习题第五章
5.3 Write a program to compute the nubmer of collisions required in a long random sequence of insertions using linear probing, quadratic probing, and double hashing.5.17 Implement a generic Map that原创 2007-03-29 16:07:00 · 1718 阅读 · 0 评论