码迷,mamicode.com
首页 >  
搜索关键字:for while until    ( 29426个结果
《Python编程:从入门到实践》PDF高清完整版网盘下载_python编程入门经典
《Python编程:从入门到实践》PDF点击直接进入下载 一、先看此教程特色 本书是一本全面的从入门到实践的Python编程教程,带领读者快速掌握编程基础知识、编写出能解决实际问题的代码并开发复杂项目。 二、内容介绍 本书是一本针对所有层次的Python读者而作的Python入门书。全书分两部分:首 ...
分类:编程语言   时间:2020-09-17 12:29:09    阅读次数:61
(vector水平衡树)【模板】普通平衡树 Luogu P3369
20行写完极其害怕 只能跑1e5的数据,那个1e6强制在线的开o2只有20pts QAQ 不用reserve也可以过,不过开了之后200ms的点只要130-140ms #include<bits/stdc++.h> using namespace std; #define ll long long ...
分类:其他好文   时间:2020-09-17 12:26:24    阅读次数:24
450. Delete Node in a BST - Medium
Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of th ...
分类:其他好文   时间:2020-09-15 21:24:11    阅读次数:42
使用指针解去指针来实现strlen(求字符串函数)函数(前几天忙着开学)
//方法1.寻找使用循环直接找到\0//intzifuchuan(chararr)//{//inti=0;//charp=arr;//while(p!=‘\0‘)//{//p++;//i++;//}//returni;//}//方法2用最大的地址减去最小的地址intzifuchuan(chararr){charmin=arr;charmax=arr;while(max!=‘
分类:其他好文   时间:2020-09-14 18:56:11    阅读次数:48
python遍历列表的方法(三种)
numbers=[1,2,3,4,5]#1.最常见的for迭代器遍历:print("最常见的for迭代器遍历:")fornumberinnumbers:print(number)#2.while遍历,通过索引取值:print("while遍历:")i=0whilei<len(numbers):print(numbers[i])i+=1#3.for配合range遍历,类似于C语言的for语句遍
分类:编程语言   时间:2020-09-14 18:41:33    阅读次数:38
求最小步变成斐波拉契数
题目描述 Fibonacci数列是这样定义的: F[0] = 0 F[1] = 1 for each i ≥ 2: F[i] = F[i-1] + F[i-2] 因此,Fibonacci数列就形如:0, 1, 1, 2, 3, 5, 8, 13, …,在Fibonacci数列中的数我们称为Fibon ...
分类:其他好文   时间:2020-09-12 21:47:00    阅读次数:39
调整数组顺序,要求所有奇数在偶数前面,常数时间复杂度
进行一次快排即可 class Solution { public: vector<int> exchange(vector<int>& nums) { int le = 0; int ri = nums.size() - 1; while(le<ri){ while (le < ri&&nums[r ...
分类:编程语言   时间:2020-09-10 22:36:24    阅读次数:38
LeetCode263. 丑数
如果一个数只包含这几个质因子,那就不断的除以这几个质因子,最后如果只剩下1,就是丑数。 class Solution { public: bool isUgly(int num) { while(num >= 5 && num % 5 == 0) { num /= 5; } while(num >= ...
分类:其他好文   时间:2020-09-07 19:13:43    阅读次数:53
从尾到头打印链表
输入一个链表的头节点,从尾到头反过来返回每个节点的值(用数组返回)。 反转:从头到尾将链表打印到数组中,返回反转后的结果即可。 class Solution: def reversePrint(self, head): res = [] while head: res.append(head.val ...
分类:其他好文   时间:2020-09-07 19:13:25    阅读次数:35
python yield生成器函数
yield是python的一个关键字,本质上是一个生成器generator。
分类:编程语言   时间:2020-09-07 18:46:12    阅读次数:44
29426条   上一页 1 ... 66 67 68 69 70 ... 2943 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!