• Bài giảng ECE 250 Algorithms and Data Structures - 5.01. Binary treesBài giảng ECE 250 Algorithms and Data Structures - 5.01. Binary trees

    Summary In this talk, we introduced binary trees – Each node has two distinct and identifiable sub-trees – Either sub-tree may optionally be empty – The sub-trees are ordered relative to the other We looked at: – Properties – Applications

    pdf32 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 974 | Lượt tải: 2

  • Bài giảng ECE 250 Algorithms and Data Structures - 4.03. Tree traversalsBài giảng ECE 250 Algorithms and Data Structures - 4.03. Tree traversals

    Summary This topic covered two types of traversals: – Breadth-first traversals – Depth-first traversals – Applications – Determination of how to structure a depth-first traversal

    pdf25 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 976 | Lượt tải: 1

  • Bài giảng ECE 250 Algorithms and Data Structures - 4.02. Abstract TreesBài giảng ECE 250 Algorithms and Data Structures - 4.02. Abstract Trees

    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.

    pdf21 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 1003 | Lượt tải: 1

  • Bài giảng ECE 250 Algorithms and Data Structures - 4.01. The Tree Data StructureBài giảng ECE 250 Algorithms and Data Structures - 4.01. The Tree Data Structure

    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 looke...

    pdf42 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 1118 | Lượt tải: 1

  • Bài giảng ECE 250 Algorithms and Data Structures - 3.05. Linked ListsBài giảng ECE 250 Algorithms and Data Structures - 3.05. Linked Lists

    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

    pdf147 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 1069 | Lượt tải: 3

  • Bài giảng ECE 250 Algorithms and Data Structures - 3.04. DequesBài giảng ECE 250 Algorithms and Data Structures - 3.04. Deques

    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

    pdf34 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 1120 | Lượt tải: 1

  • Bài giảng ECE 250 Algorithms and Data Structures - 3.03. QueuesBài giảng ECE 250 Algorithms and Data Structures - 3.03. Queues

    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

    pdf49 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 978 | Lượt tải: 3

  • Bài giảng ECE 250 Algorithms and Data Structures - 3.02. StacksBài giảng ECE 250 Algorithms and Data Structures - 3.02. Stacks

    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

    pdf104 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 1074 | Lượt tải: 2

  • Bài giảng ECE 250 Algorithms and Data Structures - 3.01. ListsBài giảng ECE 250 Algorithms and Data Structures - 3.01. Lists

    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

    pdf28 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 1150 | Lượt tải: 1

  • Bài giảng ECE 250 Algorithms and Data Structures - 2.04. Algorithm AnalysisBài giảng ECE 250 Algorithms and Data Structures - 2.04. Algorithm Analysis

    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

    pdf98 trang | Chia sẻ: vutrong32 | Ngày: 17/10/2018 | Lượt xem: 1053 | Lượt tải: 1