Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> การเขียนโปรแกรม
การเขียนโปรแกรม
  1. Level Linked (2,4)-Trees ในโครงสร้างข้อมูล

    Level Linked (2,4)-Trees (2,4)-Tree = Height-Balanced Search Tree - Leaves ทุกตัว Depth เท่ากัน - Internal Nodes Degree = 2, 3, หรือ 4 - Elements เก็บที่ Leaves, Internal Keys = Search Guides - Height = O(log n), Search = O(log n) Important Property: Insert/Delete by Finger = Amortized O(1) (ไม่ใช่

  2. Randomized Finger Search Trees (ต้นไม้ค้นหาฟิงเกอร์แบบสุ่ม) ในโครงสร้างข้อมูล

    Randomized Alternatives to Deterministic Search Trees 2 ตัวเลือกหลัก: Treaps (Randomized BSTs) และ Skip Lists ทั้งคู่ Elegant, Randomization ทำให้ Update Operations เรียบง่ายและมีประสิทธิภาพ ทั้งคู่รองรับ Finger Search ใน Expected O(log d) Time (d = Distance) Expectation = Over Random Choices ระหว่

  3. Skip Lists (ข้ามรายการ) ในโครงสร้างข้อมูล

    Finger Search ใน Skip Lists จาก Node ที่มี Element b → Finger Search หา Element a a < b → Search ย้อนหลัง (Backward) b → Search ไปข้างหน้า (Forward) Backward Case = Symmetric กับ Normal Search Forward Case = ซับซ้อนกว่า (Sentinel ที่ Start เป็น Tallest Node ปกติ → Fast) แต่ Finger อาจอยู่ที่ Height

  4. Adaptive Merging and Sorting (การผสานและจัดเรียงแบบปรับตัว) ในโครงสร้างข้อมูล

    Adaptive Merge Sort คล้าย Merge Sort แตขนาด Initial Sub-list ขึ้นกับ Existing Order ใน List ไม่ใช่คงที่ที่ 1 ตัวอย่าง List: [16,15,14,13, 9,10,11,12] → 2 Sorted Sub-lists: Sub-list 1: 16,15,14,13 (Reverse Sorted) Sub-list 2: 9,10,11,12 (Sorted) Sub-list 1 Reverse → [13,14,15,16] Merge 2 Sub-lists

  5. Splay Trees (สเพลย์ทรี) ในโครงสร้างข้อมูล

    Splay Tree คืออะไร? Splay Tree = Self-Balancing Binary Search Tree ที่มีคุณสมบัติพิเศษ: Recently Accessed Elements เข้าถึงได้เร็วขึ้น Basic Operations (Insert, Lookup, Remove): O(log n) Amortized Time สำหรับ Non-random Sequences หลายแบบ Splay Trees ทำงานดีกว่า Search Trees อื่นๆ แม้รูปแบบ Sequence

  6. Optimality of Splay Trees (ความเหมาะสมที่สุดของ Splay Trees)

    Dynamic Optimality Conjecture (推测 动态最优性) Selain Performance Guarantees ที่พิสูจน์แล้ว มี Unproven Conjecture ที่น่าสนใจมาก: ให้ Binary Search Tree Algorithm ใดๆ (B) Access Element y โดย Traverse Path จาก Root → y Cost = d(y) + 1 และระหว่าง Accesses ทำ Rotations ได้ Cost = 1 ต่อ Rotation B(s) = Cost

  7. Static Finger Theorem (ทฤษฎีฟิงเกอร์คงที่) ในโครงสร้างข้อมูล

    Static Finger Theorem ให้ f เป็น Element เฉพาะ เรียกว่า Finger Cost ของ Splaying Sequence ถูก Bound โดย: O(m + n log n + Σⱼ log(|f - iⱼ| + 1)) โดย: - m = จำนวน Update/Access Operations บน Tree ที่มี Nodes ≤ n - n = จำนวน Nodes สูงสุด - |f - i| = ระยะทางใน Symmetric Ordering ระหว่าง Finger f และ I

  8. Solid Trees (ต้นไม้แข็ง) ในโครงสร้างข้อมูล

    Solid Trees Definition ใน Forest ที่กำหนด: ทำให้บาง Edges เป็น Dashed ส่วนที่เหลือเป็น Solid Non-leaf Node แต่ละตัวมี Solid Edge เพียง 1 ตัว ไปยัง Child หนึ่งตัว (Child อื่นๆ = Dashed) Concrete Rule: Right-most Link = Solid, Other Links = Dashed Virtual Tree Construction ผลลัพธ์: Tree แยกเป็น Soli

  9. Splay ใน Virtual Tree (การเลื่อนในต้นไม้เสมือน) โครงสร้างข้อมูล

    Virtual Tree Overview ใน Virtual Tree: Edges บางส่วนเป็น Solid (แท้) บางส่วนเป็น Dashed (ขีด) Splaying ปกติทำใน Solid Trees เท่านั้น Algorithm: Splay(y) - 3 Passes Pass 1: Walk Up + Splay in Solid Subtrees Only เริ่มจาก Node y Splay ภายใน Solid Subtrees เท่านั้น จบ Pass 1: Path จาก y ถึง Root กลา

  10. Huffman Codes และ Entropy ในโครงสร้างข้อมูล

    Huffman Code (ฮัฟฟ์มันโค้ด) Huffman Code = Optimal Prefix Code ประเภทหนึ่ง ใช้ทั่วไปสำหรับ Lossless Data Compression พัฒนาโดย David A. Huffman (MIT Sc.D. Student) ตีพิมพ์ 1952 A Method for the Construction of Minimum-Redundancy Codes Output = Variable-Length Code Table สำหรับ Encode Source Symbols (

  11. Huffman Algorithm สำหรับ t-ary Trees ในโครงสร้างข้อมูล

    อัลกอริทึมง่ายๆ (Binary Huffman) เตรียม n Initial Huffman Trees (แต่ละตัว = Single Leaf Node) ใส่ Priority Queue เรียงตาม Weight (Frequency) Dequeue 2 ตัวที่ Weight น้อยสุด → Combine → New Tree: Root มี 2 Children, Weight = Sum ของ Children Enqueue New Tree กลับ Priority Queue Repeat 2-3 จนเหลือ 1

  12. Height-Limited Huffman Trees (ฮัฟฟ์มันทรีจำกัดความสูง)

    ปัญหา Huffman Construction ทั่วไป ไม่จำกัด Height/Depth ถ้าจำกัด → ไม่ Optimal แล้ว (แต่ Depth สูงสุดถูก Bound โดย Fibonacci Series) ทำไมต้องจำกัด Depth? Fast Huffman Decoders ใช้ Lookup Tables Table Size = 1 << TreeDepth (2Depth) เพื่อ Speed + Memory Management: Limit = 8 KB (Fit L1 Cache) → 4K

  13. Optimal Lopsided Trees (ทรีลำเอียงเหมาะสมที่สุด) ในโครงสร้างข้อมูล

    ปัญหา หา Optimal Prefix-free Codes สำหรับ Unequal Letter Costs (ความยาวตัวอักษรไม่เท่ากัน) Encoding Alphabet มีความยาว α, β โดย α ≤ β จำกัดเฉพาะ Binary Trees Code แทนด้วย Lopsided Tree (คล้าย Huffman Tree แทน Huffman Coding) แต่ Unequal Letter Costs ยากกว่า Huffman Problem มาก: No Polynomial-time A

  14. Bucketing Methods (วิธีบัคเก็ตติ้ง) ในโครงสร้างข้อมูล

    Bucketing คืออะไร? Hash Table เป็น 2D Array แทน 1D Array แต่ละ Entry (Bucket) จุได้ M Items (M = Constant, ไใช่จำนวนข้อมูลทั้งหมด) ปัญหาของ Bucketing Wasted Space มาก (หลาย Bucket ไม่เต็ม) ถ้าเกิน M → ต้องมี Strategy อื่น (Overflow Handling) ไม่เหมาะ Memory-based แต่ทำได้ถ้า Disk-based Buckets L

  15. Planar Straight Line Graphs (PSLGs) ในโครงสร้างข้อมูล

    PSLG คืออะไร? Planar Straight-Line Graph (PSLG) = Embedding ของ Planar Graph ใน Plane ที่ Edges เป็น Straight Line Segments Fárys Theorem (1948): ทุก Planar Graph มี Embedding แบบนี้ ใน Computational Geometry เรียกว่า Planar Subdivisions (สมมติ Polygonal) โดยไม่มี Vertices Degree 1 → PSLG กำหนด Su

  16. Halfedge Data Structure (ครึ่งขอบโครงสร้างข้อมูล)

    Introduction Halfedge Data Structure (HDS) = Edge-centered Data Structure รักษา Incidence Information ของ Vertices, Edges, Faces สำหรับ Planar Maps, Polyhedra, Orientable 2D Surfaces Embedded ใน Dimension ใดก็ได้ แต่ละ Edge แบ่งเป็น 2 Halfedges ที่มี Orientation ตรงข้าม แต่ละ Halfedge เก็บ: 1 Incid

  17. Range Trees ในโครงสร้างข้อมูล

    Range Tree คืออะไร? Range Tree = Ordered Tree Data Structure จัดเก็บ List ของ Points รองรับการ Retrieve Points ทั้งหมดใน Range ที่กำหนดได้อย่างมีประสิทธิภาพ ใช้ใน 2D ขึ้นไป คล้าย kd-tree แต่: Query เร็วกว่า O(logd n + k) แต่ Storage มากกว่า O(n logd-1 n) d = Dimension, n = จำนวน Points, k = จำนวน P

  18. Quadtrees (ควอดทรี) ในโครงสร้างข้อมูล

    Quadtrees คืออะไร? Quadtrees = Trees สำหรับจัดเก็บ Points บน 2D Space อย่างมีประสิทธิภาพ แต่ละ Node มีลูกสูงสุด 4 ตัว การสร้าง Quadtree จาก 2D Area แบ่ง 2D Space ปัจจุบันเป็น 4 Boxes ถ้า Box มี ≥1 Point → สร้าง Child Object เก็บ 2D Space ของ Box นั้น ถ้า Box ไม่มี Point → ไม่สร้าง Child Recurse สำ

Total 1490 -คอมพิวเตอร์  FirstPage PreviousPage NextPage LastPage CurrentPage:7/75  20-คอมพิวเตอร์/Page Goto:1 2 3 4 5 6 7 8 9 10 11 12 13