Thư viện tài liệu, ebook tổng hợp lớn nhất Việt Nam
Website chia sẻ tài liệu, ebook tham khảo cho các bạn học sinh, sinh viên
Tổng hợp tài liệu, ebook Công Nghệ Thông Tin tham khảo.
Summary This topic covered two types of traversals: – Breadth-first traversals – Depth-first traversals – Applications – Determination of how to structure a depth-first traversal
25 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 488 | Lượt tải: 1
Summary In this topic, we have looked at one implementation of a general tree: – store the value of each node – store all the children in a linked list – not an easy (Q(1)) way to access children – if we use an array, different problems.
21 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 482 | Lượt tải: 1
Summary In this topic, we have: – Introduced the terminology used for the tree data structure – Discussed various terms which may be used to describe the properties of a tree, including: • root node, leaf node • parent node, children, and siblings • ordered trees • paths, depth, and height • ancestors, descendants, and subtrees – We…
42 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 508 | Lượt tải: 1
Summary We have considered the implementation of linked lists in C++ – Aspects of the Node class – Accessors and mutators – The implementation of various member functions – Stepping through a linked list – Defining the copy and assignment operator – Defining move constructors and move assignment operators – Discussed efficiencies
147 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 580 | Lượt tải: 1
Summary In this topic, we have introduced the more general deque abstract data structure – Allows insertions and deletions from both ends of the deque – Internally may be represented by either a doubly-linked list or a twoended array More important, we looked at the STL and the design pattern of an iterator
34 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 499 | Lượt tải: 1
Summary The queue is one of the most common abstract data structures Understanding how a queue works is trivial The implementation is only slightly more difficult than that of a stack Applications include: – Queuing clients in a client-server model – Breadth-first traversals of trees
49 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 474 | Lượt tải: 1
Stacks The stack is the simplest of all ADTs – Understanding how a stack works is trivial The application of a stack, however, is not in the implementation, but rather: – where possible, create a design which allows the use of a stack We looked at: – parsing, function calls, and reverse Polish
104 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 624 | Lượt tải: 1
Summary In this topic, we have introduced Abstract Lists – Explicit linear orderings – Implementable with arrays or linked lists • Each has their limitations • Introduced modifications to reduce run times down to Q(1) – Discussed memory usage and the sizeof operator – Looked at the String ADT – Looked at the vector class in the STL
28 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 529 | Lượt tải: 1
Summary In these slides we have looked at: – The run times of • Operators • Control statements • Functions • Recursive functions – We have also defined best-, worst-, and average-case scenarios We will be considering all of these each time we inspect any algorithm used in this class
98 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 613 | Lượt tải: 1
Algorithms Analysis We will use Landau symbols to describe the complexity of algorithms – E.g., adding a list of n doubles will be said to be a Q(n) algorithm An algorithm is said to have polynomial time complexity if its runtime may be described by O(nd) for some fixed d ≥ 0 – We will consider such algorithms to be efficient Problems that…
55 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 483 | Lượt tải: 1