![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT
黑泽忌
这个作者很懒,什么都没留下…
展开
-
PAT advanced-1066 Root of AVL Tree (25分)【AVL】
An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is done to restore this property. Figures 1-4 illustrate t原创 2020-11-26 22:28:00 · 78 阅读 · 0 评论 -
PAT advanced-1094 The Largest Generation (25分)【树】
A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generation with the largest population. Input Specification: Each input file contains one test case. Ea原创 2020-11-23 21:54:14 · 91 阅读 · 0 评论 -
PAT advanced-1102-Invert a Binary Tree (25分)【二叉树】
1102 Invert a Binary Tree (25分) The following is from Max Howell @twitter: Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off. Now it’s your turn to prove that YOU CAN invert a原创 2020-11-16 19:30:05 · 100 阅读 · 0 评论 -
PAT advanced-1103-Integer Factorization (30分)【深搜DFS】
1103 Integer Factorization (30分) The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program to find the K−P factorization of N for any positive integers N, K and P. I原创 2020-11-05 20:24:07 · 668 阅读 · 0 评论 -
PAT advanced-1074-Reversing Linked List (25分)
1074 Reversing Linked List (25分) Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, if K=3, then you must output 3→2→1→6→5→4; if K=4, you must output 4→3→2→原创 2020-11-03 19:22:13 · 157 阅读 · 0 评论