1 / 7

517 481 Analysis and Design Algorithms

517 481 Analysis and Design Algorithms. เรื่องคัดเฉพาะทาง. วิทยาการคอมพิวเตอร์ 1. คฑา ประดิษฐวงศ์. สัปดาห์ที่ 5 - 6. Data Structure.

Download Presentation

517 481 Analysis and Design Algorithms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 517 481 Analysis and Design Algorithms เรื่องคัดเฉพาะทาง วิทยาการคอมพิวเตอร์ 1 คฑา ประดิษฐวงศ์

  2. สัปดาห์ที่ 5 - 6 Data Structure

  3. ประสิทธิภาพการทำงานของ อัลกอริทึมหนึ่ง ๆ นั้นผูกพันกับลักษณะของการจัดเก็บข้อมูลที่ใช้ระหว่างการทำงานอย่างแน่นแฟ้น การเลือกโครงสร้างข้อมูลที่เหมาะสมจะส่งผลให้การทำงานเป็นไปอย่างมีประสิทธิภาพ การจะเลือกใช้โครงสร้างข้อมูลประเภทใดนั้น ก็คงต้องขึ้นกับว่าเราต้องการบริการแบบใดจากข้อมูลที่จัดเก็บ

  4. แบ่งหัวข้อที่ศึกษาออกเป็นแบ่งหัวข้อที่ศึกษาออกเป็น Spay Tree Heap AVL

  5. Heap ซึ่งจัดเก็บข้อมูลในต้นไม้แบบทวิภาคได้ดุล โดยมีกฎการจัดเก็บว่าคีย์ที่ปมพ่อต้องมีค่าน้อยกว่าคีย์ของลูก ๆ เสมอ รากต้องมีค่าคีย์ที่น้อยสุด จึงหาคีย์น้อยสุดได้ในเวลา O(1)การเก็บฮีปแบบทวิภาค กินที่น้อยมาก ประสิทธิภาพรวดเร็ว

  6. Spay Tree ประสิทธิภาพของการดำเนินการโดยทั่วไป ของต้นไม้ค้นแบบทวิภาคนั้นแปรตามความสูงของต้นไม้ ต้นไม้สเปลย์อาศัยขั้นตอนการย้ายตำแหน่งของปมที่สนใจให้สูงขึ้นโดยการหมุน เช่นเดียวกับต้นไม้ AVL การหมุนปมนั้นมีสามรูปแบบดังนี้ zig, zig – zig, zig – zag

  7. AVL An AVLtree is a binary search tree in which the heights of the left and right subtrees of the root differ by a t most 1 and in which the left and right subtrees are again AVL trees. With each node of an AVL tree is associated a balance factor that is left high, equal, or right high according, respectively, as the left subtree has height greater than, equal to, or less than that of the right subtree

More Related