MOOC ZJU Data Structures After-Class Problems Record - PTA Data Structures Problem Set (Complete)

发表于 2020-07-05 00:18 984 字 5 min read

cos avatar

cos

FE / ACG / 手工 / 深色模式强迫症 / INFP / 兴趣广泛养两只猫的老宅女 / remote

剑指offer day31 数学(困难)剑指offer day30 分治算法(困难)剑指offer day29 动态规划(困难)剑指offer day28 搜索与回溯算法(困难)剑指offer day27 栈与队列(困难)剑指offer day26 字符串(中等)剑指offer day25 模拟(中等)剑指offer day24 数学(中等)剑指offer day23 数学(简单)剑指offer day22 位运算(中等)剑指offer day21 位运算(简单)剑指offer day20 分治算法(中等)剑指offer day19 搜索与回溯算法(中等)剑指offer day18 搜索与回溯算法(中等)剑指offer day17 排序(中等)剑指offer day16 排序(简单)剑指offer day15 搜索与回溯算法(中等)剑指offer day14 搜索与回溯算法(中等)剑指offer day13 双指针(简单)剑指offer day12 双指针(简单)剑指offer day11 双指针(简单)剑指offer day10 动态规划(中等)剑指offer day9 动态规划(中等)剑指offer day8 动态规划(简单)剑指offer day7 搜索与回溯算法(简单)剑指offer day6 搜索与回溯算法(简单)剑指offer day5 查找算法(中等)剑指offer day4 查找算法(简单)剑指offer day3 字符串(简单)剑指offer day2 链表(简单)剑指offer day1 栈与队列(简单)冲刺春招-精选笔面试66题大通关day22冲刺春招-精选笔面试66题大通关day21冲刺春招-精选笔面试66题大通关day20冲刺春招-精选笔面试66题大通关day19冲刺春招-精选笔面试66题大通关18冲刺春招-精选笔面试66题大通关17冲刺春招-精选笔面试66题大通关16冲刺春招-精选笔面试66题大通关day15冲刺春招-精选笔面试66题大通关day14冲刺春招-精选笔面试66题大通关day13冲刺春招-精选笔面试66题大通关day12冲刺春招-精选笔面试66题大通关day11冲刺春招-精选笔面试66题大通关day10冲刺春招-精选笔面试66题大通关day9冲刺春招-精选笔面试66题大通关day8冲刺春招-精选笔面试66题大通关day7冲刺春招-精选笔面试66题大通关day6冲刺春招-精选笔面试66题大通关day5冲刺春招-精选笔面试66题大通关day4冲刺春招-精选笔面试66题大通关day3冲刺春招-精选笔面试66题大通关day2冲刺春招-精选笔面试66题大通关day12021 Fall PAT Grade B Real Exam Solutions and Post-Contest SummaryPAT Grade B Practice Reflections and Pitfall SummaryPTA Data Structures Problem Set Week 3 - Planting Trees (Binary Trees, etc.)PTA Data Structure Problem Set Week 11 -- Hash SearchPTA Data Structure Problem Set Week 10 -- Sorting (Part 2)PTA Data Structure Problem Set Week 9 -- Sorting (Part 1)PTA Data Structure Problem Set Week 8 -- Graphs (Part 3)PTA Data Structure Problem Set Week 7 -- Graphs (Part 2)PTA Data Structure Problem Set Week 6 -- Graphs (Part 1)PTA Data Structures Problem Set Week 5 - Heaps & Huffman Trees & Union-FindPTA Data Structures Problem Set Week 4 - Binary Search Trees & AVL TreesPTA Data Structures Problem Set Week 2 - Linear StructuresPTA Data Structures Problem Set Week 1 - Maximum Subsequence Sum Algorithm & Binary SearchMOOC ZJU Data Structures After-Class Problems Record - PTA Data Structures Problem Set (Complete)2020 Lanqiao Cup Provincial Mock Contest Problem Record
本文是作者在学习浙大数据结构课程过程中,系统整理和记录的PTA题目集,涵盖线性结构、二叉树、图、排序、散列查找等核心数据结构与算法内容,每部分均包含题目解析与代码实现,结合C++和C语言编写,并使用STL简化部分操作,最终完成了全部课后习题的总结与学习复盘。

This article has been machine-translated from Chinese. The translation may contain inaccuracies or awkward phrasing. If in doubt, please refer to the original Chinese version.

Link to original blog: MOOC ZJU Data Structures After-Class Problems Record - PTA Data Structures Problem Set (Complete)

This blog records the problem sets done while studying data structures. Feel free to point out any mistakes in the code! It also serves as a summary of data structures~ PS: Since I had already learned C, all solutions are written in C, though there is also quite a bit of C language content. MOOC Portal

Week 1 - Maximum Subsequence Sum Algorithm & Binary Search

Code and approach linked in blog: PTA Data Structures Problem Set Week 1 - Maximum Subsequence Sum Algorithm & Binary Search

01-Complexity 1 Maximum Subsequence Sum Problem (20 pts)

01-Complexity 2 Maximum Subsequence Sum (25 pts)

01-Complexity 3 Binary Search (20 pts)

Week 2 - Linear Structures

Study notes linked in blogs: Linear Lists, Stacks After-class exercise code and approach linked in blog: PTA Data Structures Problem Set Week 2 - Linear Structures

02-Linear Structure 1 Merging Two Sorted Linked List Sequences (15 pts)

02-Linear Structure 2 Polynomial Multiplication and Addition (20 pts)

02-Linear Structure 3 Reversing Linked List (25 pts)

02-Linear Structure 4 Pop Sequence (25 pts)

Week 3 - Planting Trees (Binary Trees, etc.)

Study notes linked in blogs: Binary Trees, Queues After-class exercise code and approach linked in blog: PTA Data Structures Problem Set Week 3 - Planting Trees (Binary Trees, etc.)

03-Tree 1 Isomorphism of Trees (25 pts)

03-Tree 2 List Leaves (25 pts)

03-Tree 3 Tree Traversals Again (25 pts)

Week 4 - Binary Search Trees & AVL Trees

Study notes linked in blog: Binary Search Trees and AVL Trees After-class exercise code and approach linked in blog: PTA Data Structures Problem Set Week 4 - Binary Search Trees & AVL Trees

04-Tree 4 Is It the Same Binary Search Tree (25 pts)

04-Tree 5 Root of AVL Tree (25 pts)

04-Tree 6 Complete Binary Search Tree (30 pts)

04-Tree 7 Binary Search Tree Operations (30 pts)

Week 5 - Heaps & Huffman Trees & Union-Find

Study notes linked in blog: Heaps, Huffman Trees, and Union-Find After-class exercise code and approach linked in blog: PTA Data Structures Problem Set Week 5 - Heaps & Huffman Trees & Union-Find

05-Tree 7 Path in Heap (25 pts)

05-Tree 8 File Transfer (25 pts)

05-Tree 9 Huffman Codes (30 pts)

Week 6 - Graphs (Part 1)

Study notes linked in blog: Graphs After-class exercise code and approach linked in blog: PTA Data Structures Problem Set Week 6 - Graphs (Part 1) Topics covered include basic graph representation and traversal methods (BFS, DFS)

06-Graph 1 List Connected Components (25 pts)

06-Graph 2 Saving James Bond - Easy Version (25 pts)

06-Graph 3 Six Degrees of Separation (30 pts)

Week 7 - Graphs (Part 2)

Study notes linked in blog: Graph Theory After-class exercise code and approach linked in blog: PTA Data Structures Problem Set Week 7 - Graphs (Part 2) Topics covered include single-source shortest path algorithms (Floyd’s algorithm, Dijkstra’s algorithm)

07-Graph 4 Harry Potter’s Exam (25 pts)

07-Graph 5 Saving James Bond - Hard Version (30 pts)

07-Graph 6 Travel Planning (25 pts)

Week 8 - Graphs (Part 3)

Study notes linked in blogs: Minimum Spanning Tree (Kruskal’s & Prim’s Algorithms), Data Structures Study Notes <8> Sorting After-class exercise code and approach linked in blog: PTA Data Structures Problem Set Week 8 - Graphs (Part 3) Topics covered include minimum spanning trees, topological sorting, and critical path problems

08-Graph 7 Connecting All Villages with Roads (30 pts)

08-Graph 8 How Long Does It Take (25 pts)

08-Graph 9 Critical Activities (30 pts)

Week 9 - Sorting (Part 1)

Study blogs linked: Data Structures Study Notes <8> Sorting, Iterative Merge Sort Implementation (For Reference) After-class exercise code and approach linked in blog: PTA Data Structures Problem Set Week 9 - Sorting (Part 1) Topics covered include various sorting algorithms (insertion sort, merge sort, heap sort, etc.)

09-Sort 1 Sorting (25 pts)

09-Sort 2 Insert or Merge (25 pts)

09-Sort 3 Insertion or Heap Sort (25 pts)

Week 10 - Sorting (Part 2)

Study blog linked: Data Structures Study Notes <8> Sorting After-class exercise code and approach linked in blog: PTA Data Structures Problem Set Week 10 - Sorting (Part 2) Topics covered include applications of various sorting algorithms, struct sorting, cycle detection in table sorting, etc.

10-Sort 4 Counting Work Experience (20 pts)

10-Sort 5 PAT Judge (25 pts)

10-Sort 6 Sort with Swap(0, i) (25 pts)

Week 11 - Hash Search

Study blog linked: Data Structures Study Notes <9> Hash Search After-class exercise code and approach linked in blog: PTA Data Structures Problem Set Week 11 - Hash Search Topics covered include hash search applications, KMP, etc.

11-Hash 1 Phone Chat Addict (25 pts)

11-Hash 2 Hashing (25 pts)

11-Hash 3 QQ Account Registration and Login (25 pts)

KMP String Pattern Matching (25 pts)

Summary

While solving these problems, I intentionally used the data structure definitions taught in the MOOC for some, while for others I took shortcuts using STL. It would be painful not to use convenient tools when they are available (e.g., priority queues replacing min/max heaps, maps replacing hash lookups — STL is really handy). Regardless, after procrastinating until the last minute, I finally finished everything. This super~ long summer break was not wasted lol. Time to keep up the momentum during winter break and prepare to learn Java~ The end! [just kidding]

Insert image description here
Insert image description here

喜欢的话,留下你的评论吧~

© 2020 - 2026 cos @cosine
Powered by theme astro-koharu · Inspired by Shoka