2018年1月的全部文章
@kidultff

PAT-A 真题- 1103. Integer Factorization

原题干: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. ...
  • 0
  • 0
@kidultff

C语言-深度优先搜索(DFS)

0x00、从迷宫说起    假设你现在处于一个这样的巨大的迷宫中,没有通讯工具,没有上帝视角,无法激活巴拉拉正能量,只能靠自己,从红色的脚印走到绿色的脚印,你会怎么走?相信你的答案一定是正确的。在没有地图的情况下,走 ...
  • 0
  • 3
@kidultff

PAT-B 真题- 1075. 链表元素分类 / A 1133 Splitting A Linked List

原题干:给定一个单链表,请编写程序将链表元素进行分类排列,使得所有负值元素都排在非负值元素的前面,而[0, K]区间内的元素都排在大于K的元素前面。但每一类内部元素的顺序是不能改变的。例如:给定链表8→7→-4→0→5→-6→10→11→-2,K 为 10,则输 ...
  • 0
  • 0
@kidultff

PAT-A 真题- 1032. Sharing

题干:To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same suffix. For example, "loading" and "being" ...
  • 0
  • 1
@kidultff

C语言-优先队列(priority queue)详解

0x00、优先队列(priority queue)priority queue是一个用"堆"实现的,类似set的容器,有着queue的基本功能。特征是"具有优先级,可以按照优先级出队"可能不是特别好理解,其实就是一个排序啦。。。举个栗子:3入队,4入队,1入队,如果是queue的容 ...
  • 3
  • 5