![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
练习
无限coding
这个作者很懒,什么都没留下…
展开
-
Python九九乘法表
for i in range (1, 10): s = '' for j in range (1, i + 1): s = s + str(j) + '*' + str(i) + '=' + str(i * j) + '\t' print s原创 2014-08-01 09:43:48 · 682 阅读 · 0 评论 -
二叉树的基本操作
#include #include #include using namespace std; int cur; typedef struct binarytree { int value; struct binarytree *lchild; struct binarytree *rchild; }node; //先序建立二叉树 node *creat(node *p, int原创 2014-08-28 09:34:48 · 477 阅读 · 0 评论 -
利用Python备份文件2(Windows下)
import os import time # 1. The files and directories to be backed up are specified in a list. source = [r'D:\important'] # If you are using Windows, use source = [r'C:\Documents', r'D:\Work'] or s原创 2014-06-07 15:15:59 · 634 阅读 · 0 评论 -
折半查找算法的实现
#include int find_mid(int array[], int n, int input) { int low = 0, high = n - 1; int mid; if (n < 1) return -1; while (low <= high) { mid = (low + high) / 2; if (array[mid] == input)原创 2014-08-27 20:20:51 · 724 阅读 · 0 评论 -
链表的基本操作
#include #include typedef struct list{ int value; struct list *next; }node; node* add(node *head) //增加节点 { node *p = head, *p2; int tmp; char ch; scanf("%d", &tmp); ch = getchar(); p2 =原创 2014-08-27 15:54:18 · 462 阅读 · 0 评论 -
利用Python备份文件(Windows下)
import os import time # 1. The files and directories to be backed up are specified in a list. source = [r'D:\important'] # If you are using Windows, use source = [r'C:\Documents', r'D:\Work']原创 2014-06-07 14:59:31 · 887 阅读 · 0 评论 -
kmp算法的实现
#include #include #include //计算next数组 void get_next(char *pstr, int next[]) { int len = strlen(pstr); next[0] = -1; int pre = -1; int post = 0; while (post < len - 1) { if (pre == -1 || ps原创 2014-09-08 10:02:09 · 460 阅读 · 0 评论 -
八大排序算法的实现
八大排序算法的简单实现原创 2014-08-13 16:21:45 · 656 阅读 · 0 评论 -
双向链表的基本操作
双向链表 用C++实现一个双向链表(元素类型为int),需支持 a、两个链表之间的深拷贝 b、两个链表的拼接 c、从链表头插入/删除元素 d、查找链表中的某个元素 e、返回链表中指定下标的元素原创 2014-09-04 16:01:23 · 613 阅读 · 0 评论 -
两个整数间1出现的次数
输入一个整数n,求从1到n这n个整数的十进制表示中1出现的次数。原创 2014-06-29 19:13:43 · 1097 阅读 · 0 评论 -
求两个有序数组的中值
设数组a的长度为m, 数组B的长度为n, 两个数组都都是递增有序的。 求这两个数组的中位数 首先我们看看中位数的特点,一个大小为n的数组, 如果n是奇数,则中位数只有一个,数组中恰好有 (n-1)/2 个元素比中位数小。 如果n是偶数,则中位数有两个(下中位数和上中位数),这里我们只求下中位数,对于下中位数, 数组中恰好有(n-1)/2个元素比下中位数小。 此题中,中原创 2014-06-29 18:50:48 · 627 阅读 · 0 评论