自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(26)
  • 资源 (9)
  • 收藏
  • 关注

原创 PAT甲级 1115 Counting Nodes in a BST (30 分)bst

1115 Counting Nodes in a BST (30 分) 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 with keys le...

2018-11-29 21:14:55 159

原创 PAT甲级 1113 Integer Set Partition (25 分)数学问题

1113 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, respectively. Let S​...

2018-11-29 16:49:10 141

原创 PAT甲级 1112 Stucked Keyboard (20 分)

1112 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 repeatedly on screen fo...

2018-11-29 15:35:49 188

原创 PAT甲级 1110 Complete Binary Tree (25 分)完全二叉树、dfs

1110 Complete Binary Tree (25 分) Given a tree, you are supposed to tell if it is a complete binary tree. Input Specification: Each input file contains one test case. For each case, the first line g...

2018-11-29 10:32:23 175

原创 PAT甲级 1108 Finding Average (20 分)字符串处理

1108 Finding Average (20 分) The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input numbers might not be l...

2018-11-25 21:27:06 226

原创 sscanf与sprintf用法

参考链接:https://blog.csdn.net/sim120/article/details/22872885 sscanf: 从字符串中拆分出想要的类型 sprintf: 把各种类型的东西合成一个字符串 示例代码如下: #include <stdio.h> int main(void) { char buf[20] = "1:23:abc"; in...

2018-11-25 17:47:58 170

原创 PAT甲级 1106 Lowest Price in Supply Chain (25 分)dfs

1106 Lowest Price in Supply Chain (25 分) A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer. Start...

2018-11-24 17:35:31 177

原创 PAT甲级 1105 Spiral Matrix (25 分)模拟

1105 Spiral Matrix (25 分) This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasing order. A spiral matrix is filled in from the first element at the uppe...

2018-11-24 11:51:14 190

原创 给定一个数和一个数组,在数组中找到两个值之和为给定数,显示所有情况,要求复杂度为O(n)

首先对数组进行排序,时间复杂度为(N*log2N)。 然后令i = 0,j = n-1,看arr[i] + arr[j] 是否等于Sum,如果是,则结束。如果小于Sum,则i = i + 1;如果大于Sum,则 j = j – 1。这样只需要在排好序的数组上遍历一次,就可以得到最后的结果,时间复杂度为O(N)。两步加起来总的时间复杂度O(N*log2N),下面这个程序就利用了这个思想,代码如下所...

2018-11-20 22:41:53 1495

原创 PAT甲级 1102 Invert a Binary Tree (25 分)树的遍历(bfs+dfs)

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...

2018-11-20 18:20:59 164

原创 PAT甲级 1104 Sum of Number Segments (20 分)数学问题

1104 Sum of Number Segments (20 分) Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we have 10 segme...

2018-11-20 17:11:46 155

原创 PAT甲级 1100 Mars Numbers (20 分)map、string

1100 Mars Numbers (20 分) People on Mars count their numbers with base 13: Zero on Earth is called "tret" on Mars. The numbers 1 to 12 on Earch is called "jan, feb, mar, apr, may, jun, jly, aug, sep...

2018-11-20 16:30:59 180

原创 PAT甲级 1096 Consecutive Factors (20 分)

1096 Consecutive Factors (20 分) Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3×5×6×7, where 5, 6, and 7 are the thre...

2018-11-18 21:15:06 159

原创 PAT甲级 1095 Cars on Campus (30 分)排序

参考链接:https://www.liuchuo.net/archives/2951 1095 Cars on Campus (30 分) Zhejiang University has 8 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of t...

2018-11-18 16:45:48 309

原创 PAT甲级 1101 Quick Sort (25 分) 快排

1101 Quick Sort (25 分) There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then the elements less than the p...

2018-11-17 12:07:38 211

原创 1099 Build A Binary Search Tree (30 分)dfs、bfs、bst

1099 Build A Binary Search Tree (30 分) 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 with keys...

2018-11-12 11:52:01 248

原创 PAT甲级 1097 Deduplication on a Linked List (25 分)链表

1097 Deduplication on a Linked List (25 分) Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each value K,...

2018-11-09 22:41:32 188

原创 PAT甲级 1094 The Largest Generation (25 分)BFS,树的宽度

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 ...

2018-11-09 22:36:59 143

原创 1091 Acute Stroke (30 分)BFS

1091 Acute Stroke (30 分) One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions are identified in each M...

2018-11-08 16:42:08 513

原创 PAT甲级 1093 Count PAT's (25 分)逻辑题

参考链接:https://www.liuchuo.net/archives/1896 1093 Count PAT's (25 分) The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the se...

2018-11-07 20:10:34 313

原创 百度iOS面试题 打印1-100的所有素数(各种优化版)

参考链接:https://www.cnblogs.com/ray-coding-in-rays/p/6143201.html 打印素数表的四种方法 题目:给出一个正整数n,打印出所有从1~n的素数(即质数);   1.傻瓜解法 1 int i,n; 2 while(scanf("%d",&n)!=EOF) 3 { 4 for(i=2;i<n;...

2018-11-06 15:36:01 698

原创 PAT甲级 1092 To Buy or Not to Buy (20 分)hash散列

1092 To Buy or Not to Buy (20 分) Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of beads. However th...

2018-11-05 20:13:29 136

原创 PAT甲级 1089 Insert or Merge (25 分)排序模拟(直插排序与非递归归并排序)

1089 Insert or Merge (25 分) According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one...

2018-11-05 15:26:58 212

原创 PAT甲级 1090 Highest Price in Supply Chain (25 分)dfs (树的遍历)

1090 Highest Price in Supply Chain (25 分) A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer. Star...

2018-11-04 15:05:31 133

原创 直接插入排序

时间复杂度:O(n的平方)   空间复杂度:O(1) #include <iostream> #include <vector> using namespace std; vector<int> arr,temp; void insertSort(vector<int> &arr,int n){ int i,j; fo...

2018-11-04 10:17:15 94

原创 PAT甲级 1088 Rational Arithmetic (20 分)数学运算

1088 Rational Arithmetic (20 分) For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient. Input Specification: Ea...

2018-11-03 11:45:28 123

背包九讲-2.0

动态规划之经典背包问题,让你更清楚如何求解DP问题!

2018-09-16

吴恩达2014机器学习作业(全部完整!!!作业全部代码已补全且运行结果无误!!!)

这些作业本人亲自都做完过一遍,里面的作业代码我已经补充完整,而且代码简洁清晰,全部可以直接运行出最终结果。方便你参考完成作业!!作业内容数据文档全都完整,而且没有任何问题!!!

2018-06-20

吴恩达机器学习作业(完整版!!亲自做过!)

吴恩达2014机器学习课程对应全部作业,内有详细代码以及题目说明文档!!代码清晰,亲自做过无任何问题!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2018-05-29

Python网络数据采集

作者:Ryan Mitchell 书采用简洁强大的Python语言,介绍了网络数据采集,并为采集新式网络中的各种数据类型提供了全面的指导。第一部分重点介绍网络数据采集的基本原理:如何用Python从网络服务器请求信息,如何对服务器的响应进行基本处理,以及如何以自动化手段与网站进行交互。第二部分介绍如何用网络爬虫测试网站,自动化处理,以及如何通过更多的方式接入网络。

2018-04-27

机器学习实战源代码

Peter机器学习实战书籍对应的源代码!!!Peter机器学习实战书籍对应的源代码!!!Peter机器学习实战书籍对应的源代码!!!Peter机器学习实战书籍对应的源代码!!!Peter机器学习实战书籍对应的源代码!!!

2018-04-27

机器学习实战

机器学习是人工智能研究领域中的一个极其重要的方向。在现今大数据时代的背景下捕获数据并从中萃取有价值的信息或模式使得这一过去为分析师与数学家所专属的研究领域越来越为人们瞩目。本书通过精心排的实例切入日常工作任务摒弃学术化语言利用高效可复用的Python 代码阐释如何处理统计数据进行数据分析及可视化。读者可从中学到一些核心的机器学习算法并将其运用于某些策略性任务中如分类、预测及推荐等。本书适合机器学习相关研究人员及互联网从业人员学习参考。

2018-04-27

Effective C++中文版

Effective C++是世界顶级C++大师Scott Meyers的成名之作,初版于1991年。在国际上,这本书所引起的反响之大,波及整个计算机技术出版领域,余音至今未绝。几乎在所有C++书籍的推荐名单上,这部专著都会位于前三名。作者高超的技术把握力,独特的视角、诙谐轻松的写作风格、独具匠心的内容组织,都受到极大的推崇和仿效。 书中的50条准则,每一条都扼要说明了一个可让你写出更好的C++ 程序代码的方法,并以特别设计过的例子详加讨论。在此第二版中,Meyers重新检验了每一准则,特别注意兼容于C++标准规格与现行编译器技术,并融入软件界对C++运用的最新观察结果。

2018-04-27

OpenCV3-毛星云编程入门

《OpenCV3编程入门》要求读者具有基础的C/C++知识,适合研究计算机视觉以及相关领域的在校学生和老师、初次接触OpenCV但有一定C/C++编程基础的研究人员,以及已有过OpenCV 1.0编程经验,想快速了解并上手OpenCV2、OpenCV3编程的计算机视觉领域的专业人员。《OpenCV3编程入门》也适合于图像处理、计算机视觉领域的业余爱好者、开源项目爱好者做为通向新版OpenCV的参考手册之用。

2018-04-27

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除