1. Trang chủ
  2. » Công Nghệ Thông Tin

Bài giảng cấu trúc dữ liệu và giải thuật 15

243 23 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Cấu trúc

  • ‎F:\Tải Sách\cau-truc-du-lieu-va-giai-thuat_truong-tuan-anh_dataalgo-intro - [cuuduongthancong.com].pdf‎

    • Foundations in Data Structure and Algorithms

    • Outline

    • What is Data?

    • What is Data?

    • Data Type

    • Data Structure

    • Abstract Data Type

    • Abstract Data Type

    • Example: List

    • Algorithm

    • Pseudocode

    • Pseudocode

    • Pseudocode

    • Pseudocode: Example

    • Data Structures

    • Data Structures

    • Data Structures

    • Data Structures

    • Data Structures

    • Exercise

    • Class

    • Class: Example

    • Class

    • Class

    • Array

    • Class

    • Algorithm Efficiency

    • Algorithm Efficiency

    • Linear Loop

    • Linear Loop

    • Logarithmic Loops

    • Logarithmic Loops

    • Nested Loop

    • Nested Loop

    • Quadratic Loop

    • Dependent Quadratic Loop

    • Quadratic Loop

    • Asymptotic Complexity

    • Big-O Notation

    • Example

    • Big-O Notation

    • arrayMax Example

    • arrayMax Example

    • Standard Measures of Efficiency

    • Standard Measures of Efficiency

    • Big-O Analysis Example

    • Big-O Analysis Example

    • Big Omega -notation

    • Example

    • Time Costing Operations

    • Time Costing

    • Read More

    • Takeaways

  • ‎F:\Tải Sách\cau-truc-du-lieu-va-giai-thuat_truong-tuan-anh_dataalgo-info - [cuuduongthancong.com].pdf‎

    • Data Structures and Algorithms (COS204)

    • Course Outline

    • Bibliography

    • Assessments

    • Contacts

    • Q&A

  • ‎F:\Tải Sách\cau-truc-du-lieu-va-giai-thuat_truong-tuan-anh_dataalgo-lists - [cuuduongthancong.com].pdf‎

    • Linked Lists

    • Outline

    • Linked List

    • Linked List: Implementing in C++

    • Nodes

    • Nodes

    • Nodes: Implementing in C++

    • Nodes: Implementing in C++

    • Nodes: Example

    • Nodes: Example

    • Linked List Operations

    • Create an Empty Linked List

    • Create an Empty Linked List

    • Insert a Node into an Empty Linked List

    • Insert a Node into an Empty Linked List

    • Insert a Node at the Beginning of a List

    • Insert a Node in the Middle of a List

    • Insert a Node at the End of a List

    • Insert a Node into a List

    • Insert a Node into a List

    • Delete a node from a linked list

    • Delete First Node

    • General Deletion Case

    • Delete a Node from a Linked List

    • Delete a Node from a Linked List

    • Destroy a Linked List

    • Destroy a Linked List

    • Searching in a Linked List

    • Searching in a Linked List

    • Searching in a Linked List

    • Other Lists

    • Takeaways

  • ‎F:\Tải Sách\cau-truc-du-lieu-va-giai-thuat_truong-tuan-anh_dataalgo-pratice_1 - [cuuduongthancong.com].pdf‎

    • Lab Assignments

    • Assignment 1

    • Assignment 2

    • Assignment 3

    • Assignment 4

    • Assignment 5

    • Class

    • Class: Example

    • Class

    • Class

    • Assignment 6

    • Assignment 7

    • Assignment 8

    • Assignment 9

    • Assignment 10

    • Assignment 11

  • ‎F:\Tải Sách\cau-truc-du-lieu-va-giai-thuat_truong-tuan-anh_dataalgo-sorting - [cuuduongthancong.com].pdf‎

    • Sorting

    • Outline

    • Sorting

    • Sorting

    • Sorting: Classification

    • Exchange Sort

    • Bubble Sort

    • Bubble Sort

    • Bubble Sort

    • Bubble Sort

    • Bubble Sort: Efficiency

    • Selection Sort

    • Selection Sort

    • Selection Sort

    • Selection Sort

    • Selection Sort

    • Selection Sort

    • Selection Sort

    • Selection Sort

    • Selection Sort

    • Insertion Sort

    • Insertion Sort

    • Insertion Sort

    • Insertion Sort

    • Insertion Sort

    • Insertion Sort

    • Insertion Sort

    • Insertion Sort

    • Insertion Sort

    • Divide-and-Conquer Sort

    • Divide-and-Conquer Sort

    • Quick Sort

    • Quick Sort

    • Quick Sort

    • Quick Sort

    • Takeaways

  • ‎F:\Tải Sách\cau-truc-du-lieu-va-giai-thuat_truong-tuan-anh_dataalgo-stackqueue - [cuuduongthancong.com].pdf‎

    • Stacks and Queues

    • Outline

    • Stacks

    • Basic Operations of Stacks

    • Push an Element

    • Push an Element: Overflow

    • Pop an Element

    • Pop an Element: Underflow

    • Using Linked List

    • Using Linked List

    • Using Linked List: C++

    • Create an empty Linked Stack

    • Push Data into a Linked Stack

    • Push Data into a Linked Stack

    • Push Data into a Linked Stack: C++

    • Pop Linked Stack

    • Pop Linked Stack: C++

    • Destroy a Linked Stack

    • Destroy a Linked Stack

    • Print out a Linked Stack

    • Using a Linked Stack

    • Read More

    • Queues

    • Basic Operations of Queues

    • Enqueue

    • Dequeue

    • Using Linked List

    • Using Linked List

    • Using Linked List: C++

    • Creating Queue

    • Creating Queue

    • Enqueue: Insert into an Empty Queue

    • Enqueue: Insert into a Queue

    • Enqueue: C++

    • Dequeue: Delete an Item in a Queue Having only one Item

    • Dequeue: Delete an Item in a Queue

    • Dequeue: C++

    • Destroy a Linked Queue

    • Destroy a Linked Queue

    • Print out a Linked Queue

    • Using a Linked Queue

    • Read More

    • Takeaways

  • ‎F:\Tải Sách\cau-truc-du-lieu-va-giai-thuat_truong-tuan-anh_dataalgo-trees - [cuuduongthancong.com].pdf‎

    • Trees

    • Outline

    • Trees

    • Degree of Trees

    • Degree of Trees

    • Trees

    • Trees

    • Trees

    • Trees

    • Binary Trees

    • Binary Trees: Properties

    • Binary Trees: Properties

    • Binary Trees: Structure

    • Binary Tree Structure: Linked List Implementation

    • Binary Trees: Traversals

    • Depth-first Traversals

    • Preorder Traversal (NLR)

    • Inorder Traversal (NLR)

    • Postorder Traversal (NLR)

    • Breadth-First Traversals

    • Binary Search Trees

    • Valid Binary Search Trees

    • Invalid Binary Search Trees

    • Binary Search Trees (BST)

    • Binary Search Trees: Traversals

    • Insert a Node into BST

    • Delete a Node from BST

    • Delete a Node from BST

    • Delete a Node from BST

    • Delete a Node from BST

    • Delete a Node from BST

    • Takeaways

Nội dung

Foundations in Data Structure and Algorithms Truong Tuan Anh CSE-HCMUT Outline Basic concepts z Revision z What is Data? What is Data? z Data z z Example z z z Data is information that has been translated into a form that is more convenient to calculate and analyze Numbers, words, measurements, observations or descriptions of things Qualitative data: descriptive information Quantitative data: numerical information (numbers) z z Discrete data: can only take certain values (like whole numbers) Continuous data: can take any value (within a range) Data Type z Class of data objects that have the same properties Define a data type A set of values A set of operations on values z Example Data Structure z What is a data structure? A combination of elements in which each is either a data type or another data structure A set of associations or relationships (structure) that holds the data together z Example z An array is a number of elements of the same type in a specific order Abstract Data Type z Aim z z z Users know what a data type can How it is done is hidden Definition An abstract data type is a data declaration packaged together with the operations that are meaningful for the data type Declaration of data Declaration of operations Encapsulation of data and operations Abstract Data Type Example: List z Interface Data: sequence of elements of a particular data type z Operations: accessing, insertion, deletion z z Implementation z z Array Linked list Algorithm What is an algorithm? The logical steps to solve a problem What is a program? Program = Data structures + Algorithms (Niklaus Wirth) 10 Breadth-First Traversals z In the breadth-first traversal of a binary tree, we process all of the children of a node before proceeding with the next level 21 Binary Search Trees 22 Binary Search Trees z A binary search tree is a binary tree with the following properties: All items in the left subtree are less than the root All items in the right subtree are greater than or equal to the root Each subtree is itself a binary search tree 23 Valid Binary Search Trees 24 Invalid Binary Search Trees 25 Binary Search Trees (BST) z z z BST is one of implementations for ordered list In BST we can search quickly (as with binary search on a contiguous list) In BST we can make insertions and deletions quickly (as with a linked list) 26 Binary Search Trees: Traversals 27 Operations 28 Insert a Node into BST z All BST insertions take place at a leaf or a leaflike node (a node that has only one null branch) 29 Delete a Node from BST z Deletion of a leaf: Set the deleted node's parent link to NULL 30 Delete a Node from BST z Deletion of a node having only right subtree or left subtree: Attach the subtree to the deleted node's parent 31 Delete a Node from BST z Deletion of a node having both subtrees: z Replace the deleted node by its predecessor or by its successor, recycle this node instead 32 Delete a Node from BST 33 Delete a Node from BST 34 Takeaways Basic concepts z Trees z 35 ... Statement constructs: sequence, selection, iteration 13 Pseudocode: Example 14 Data Structures 15 Data Structures 16 Data Structures A member of an object can be accessed directly by a dot (.)

Ngày đăng: 01/03/2022, 14:02

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN