摘要: 一个整型数组里除了两个数字之外,其他的数字都出现了两次。请写程序找出这两个只出现一次的数字。#include<stdlib.h>#include<iostream>#include<stdio.h>#include<vector>#include<time.h>#include<set>#include<map>#include<assert.h>#include<string>#include<stack>using namespace std;void find_data 阅读全文
posted @ 2012-08-25 16:02 wuzhibin 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 有两颗二叉树A,B 判断A是否包含B思路: 第一步,在A中找到B的根节点,记录下此时A中的节点,把此节点作为下一步的根节点 第二步,分别从根往下搜索,判断是否会遇到不等的值typedef struct treenode{ int data; struct treenode *left; struct treenode *right;}treenode;int value[100],tnums;//建树void creat_tree(treenode **head,int i){ if(i>tnums-1) *head=NULL; else { treenode *... 阅读全文
posted @ 2012-08-25 10:56 wuzhibin 阅读(223) 评论(0) 推荐(0) 编辑