christy99cc

导航

2019年11月11日 #

基于递归的折半查找

摘要: 描述 请编写一个递归的折半查找算法,查找给定有序数组中的某一元素。 输入 多组数据,每组数据有三行。第一行为数组长度n,第二行为n个递增排列的数字,第三行为需要查找的数字k。当n=0时输入结束。 输出 每组数据输出一行,如果可以找到数字,则输出“YES”,否则输出“NO”。 样例输入1 5 1 4 阅读全文

posted @ 2019-11-11 20:50 christy99cc 阅读(472) 评论(0) 推荐(0) 编辑

2019年10月27日 #

【设计模式】FactoryPattern工厂模式

摘要: Factory Pattern 简单工厂模式 将变化的部分封装起来 工厂方法模式 It defines an interface for creating an object, but lets subclasses decide which class to instantiate. Factor 阅读全文

posted @ 2019-10-27 11:42 christy99cc 阅读(152) 评论(0) 推荐(0) 编辑

2019年8月3日 #

转载: 2019.8.3

摘要: pesq https://blog.csdn.net/sinat_35821976/article/details/80081176 阅读全文

posted @ 2019-08-03 20:29 christy99cc 阅读(99) 评论(0) 推荐(0) 编辑

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

摘要: https://blog.csdn.net/ztf312/article/details/50708302 报错原因: Numpy对逻辑表达式判别不清楚,它可以返回False如果等号两边两个式子是数值相等,也可以返回True因为等号两边两个式子是逻辑相等。它觉得这是模棱两可的,因此放弃做判断,统一用 阅读全文

posted @ 2019-08-03 13:56 christy99cc 阅读(12418) 评论(0) 推荐(0) 编辑

2019年8月2日 #

python: TypeError: not enough arguments for format string

摘要: 对后面参数加上括号 阅读全文

posted @ 2019-08-02 21:28 christy99cc 阅读(1039) 评论(0) 推荐(0) 编辑

python:TypeError: main() takes 0 positional arguments but 1 was given

摘要: TypeError: main() takes 0 positional arguments but 1 was given 括号里加上self就好了 阅读全文

posted @ 2019-08-02 21:23 christy99cc 阅读(4526) 评论(0) 推荐(0) 编辑

2019年4月8日 #

VS2017 C/C++输入密码显示*星号

摘要: VS2017 C/C++输入密码显示*星号 _getch()函数使用时遇到的坑 参考: https://blog.csdn.net/guin_guo/article/details/46237905 想实现输入密码不回显的功能,找到了上面一篇文章。上面那篇文章中的代码在dev里跑没有出现任何问题。 阅读全文

posted @ 2019-04-08 18:18 christy99cc 阅读(1871) 评论(0) 推荐(1) 编辑

2018年11月10日 #

numpy的函数使用(一):np.arrange()

摘要: arrange函数用于创建等差数组。 返回一个有起点和终点固定长的list e.g.[1, 2, 3],起点是1,终点是5,步长是1。步长相当于等差数列中的公差。 参数:可以接受1、2、3个参数。 注意:如果起始值大于终点值,会生成空的一维数组。 阅读全文

posted @ 2018-11-10 00:42 christy99cc 阅读(6415) 评论(0) 推荐(0) 编辑

2018年11月9日 #

递归求解单链表中的最大值

摘要: 1 #include 2 using namespace std; 3 4 typedef struct LNode { 5 int data; 6 LNode *next; 7 }Lnode, *LinkList; 8 9 bool InitList(LinkList &L) 10 { 11 L = new LNode; 12 L->nex... 阅读全文

posted @ 2018-11-09 17:14 christy99cc 阅读(2804) 评论(0) 推荐(0) 编辑