• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






tccbj

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2019年2月26日

PAT A1115 Counting Nodes in a BST (30 分)——二叉搜索树,层序遍历或者dfs
摘要: A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes 阅读全文
posted @ 2019-02-26 20:17 tccbj 阅读(208) 评论(0) 推荐(0)
 
PAT A1113 Integer Set Partition (25 分)——排序题
摘要: Given a set of N (>1) positive integers, you are supposed to partition them into two disjoint sets A​1​​ and A​2​​ of n​1​​ and n​2​​ numbers, respect 阅读全文
posted @ 2019-02-26 16:27 tccbj 阅读(196) 评论(0) 推荐(0)
 
PAT A1112 Stucked Keyboard (20 分)——字符串
摘要: On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear rep 阅读全文
posted @ 2019-02-26 16:08 tccbj 阅读(256) 评论(0) 推荐(0)
 
PAT A1118 Birds in Forest (25 分)——并查集
摘要: Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in the same picture belong to the same tree. You are 阅读全文
posted @ 2019-02-26 15:09 tccbj 阅读(383) 评论(0) 推荐(0)
 
PAT A1117 Eddington Number (25 分)——数学题
摘要: British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, he has even defined an "Eddington number", E -- tha 阅读全文
posted @ 2019-02-26 14:09 tccbj 阅读(143) 评论(0) 推荐(0)
 
PAT A1123 Is It a Complete AVL Tree (30 分)——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 阅读全文
posted @ 2019-02-26 10:30 tccbj 阅读(397) 评论(0) 推荐(0)
 
PAT A1122 Hamiltonian Cycle (25 分)——图遍历
摘要: The "Hamilton cycle problem" is to find a simple cycle that contains every vertex in a graph. Such a cycle is called a "Hamiltonian cycle". In this pr 阅读全文
posted @ 2019-02-26 09:03 tccbj 阅读(206) 评论(0) 推荐(0)