上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 31 下一页
摘要: /* * Watermelon.cpp * * Created on: 2013-10-8 * Author: wangzhu *//** * 若n是偶数,且大于2,则输出YES, * 否则输出NO */#include#includeusing namespace std;int main() { int n; while (~scanf("%d", &n)) { if (n > 2 && (n & 1) == 0) { printf("YES\n"); } else { printf("NO\n... 阅读全文
posted @ 2013-10-08 15:54 qingyezhu 阅读(258) 评论(0) 推荐(0)
摘要: /* * binarysort.cpp * * Created on: 2013-10-8 * Author: wangzhu */#include#includeusing namespace std;#define NMAX 1000int arr[NMAX];int binarySearch(int left, int right, int key) { while (left = key) { right = mid - 1; } else { left = mid + 1; } } ... 阅读全文
posted @ 2013-10-08 09:14 qingyezhu 阅读(217) 评论(0) 推荐(0)
摘要: /* * c.cpp * * Created on: 2013-10-7 * Author: wangzhu */#include#includeusing namespace std;#define NMAX 100010struct Node { //index:表示两个数直接的距离(-1:表示未开始,0:表示开始:> 0:表示有了距离 //val:记录最后一次的位置 //flag:不符合条件 (0:表示符合条件,1:表示不符合条件) int index, val, flag;} node[NMAX];int main() { freopen("d... 阅读全文
posted @ 2013-10-07 23:53 qingyezhu 阅读(248) 评论(0) 推荐(0)
摘要: /* * c.cpp * * Created on: 2013-10-7 * Author: wangzhu */#include#includeusing namespace std;struct Node { int key; Node* next;};void addToTail(Node* root, int val) { Node* node = new Node; node->key = val; node->next = NULL; if (root->next == NULL) { root->next = node... 阅读全文
posted @ 2013-10-07 18:57 qingyezhu 阅读(185) 评论(0) 推荐(0)
摘要: /* * a.cpp * * Created on: 2013-10-7 * Author: wangzhu */#include#includeusing namespace std;struct Node { int key; Node* next;};void addToHead(Node* root, int val) { Node* tempNode = root->next; Node* node = new Node; node->key = val; node->next = tempNode; root->next = n... 阅读全文
posted @ 2013-10-07 18:18 qingyezhu 阅读(143) 评论(0) 推荐(0)
摘要: /* * c.cpp * * Created on: 2013-10-7 * Author: wangzhu */#include#include#includeusing namespace std;struct Node { int key; Node* next;};/** * 尾插法:超时 */void addToTail(Node* root, int value) { Node* node = new Node(); node->key = value; node->next = NULL; if (root->next == NUL... 阅读全文
posted @ 2013-10-07 18:03 qingyezhu 阅读(242) 评论(0) 推荐(0)
摘要: /* * c.cpp * * Created on: 2013-10-7 * Author: wangzhu */#include#includeusing namespace std;#define NMAX 1000010int arr[NMAX];/** * 只需要从左下角或右上角开始查找,即可。 * 当是从右上角开始查找时, * 左上角(row = 0,column = columns - 1), * 1)若查找的值key大于当前的值arr[i],则说明key在此行以下,故有row++; * 2)若查找的值key小于当前的值arr[i],则说明key在此列的左边,故有col... 阅读全文
posted @ 2013-10-07 16:00 qingyezhu 阅读(169) 评论(0) 推荐(0)
摘要: hdu 1754/* * c.cpp * * Created on: 2013-10-6 * Author: wangzhu */#include#includeusing namespace std;#define MAX -1struct Node { int left, right, max; Node *leftChild, *rightChild;} node[800010];int getMax(int a, int b) { return a > b ? a : b;}int pos;void build(Node *root, int left, ... 阅读全文
posted @ 2013-10-07 00:01 qingyezhu 阅读(195) 评论(0) 推荐(0)
摘要: ajaxѧϰ 简单的使用Ajax,多多指教!谢谢! 阅读全文
posted @ 2013-08-13 14:07 qingyezhu 阅读(650) 评论(0) 推荐(0)
摘要: package com.wangzhu.sort;/** * 冒泡排序算法* @ClassName: BubbleSort * @Description: TODO* @author wangzhu* @date 2013-8-12 上午10:37:28 * */public class BubbleSort { /** * @param args */ public static void main(String[] args) { int[] arr1 = new int[]{10,9,8,7,6,5,4,3,2,1}; sort(a... 阅读全文
posted @ 2013-08-12 10:39 qingyezhu 阅读(276) 评论(0) 推荐(0)
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 31 下一页