12 2012 档案
单片机呼吸灯代码
摘要:1 //****************************** 2 // 51单片机模拟呼吸灯 3 // 2012.9.23 4 // 5 // p0.0接一个LED灯,状态0为亮 6 //****************************** 7 8 9 #include<reg52.h>10 #define N 2 //亮暗的速率11 #define T 800 //PWM的周期12 13 14 //sbit led0=P0^0;15 //======================16 void pwm(int x)17 {18 whi...
阅读全文
【数据结构练习】排序——堆排序和快排
摘要:上机考试考完了,但是笔试还没有考,所以把以前的代码翻了出来研究研究主要是研究快排和堆排序 1 //============================================================================ 2 // Name : leap.cpp 3 // Author : 4 // Version : 5 // Copyright : Your copyright notice 6 // Description : Hello World in C++, Ansi-style 7 //======...
阅读全文
【数据结构上机练习】考试题目 3
摘要:代码:#include <iostream>#include<stack>#include<queue>#include<cstdio>#include<cstring>using namespace std;typedef struct Node{ char data; int le; Node * left,*right; Node(){le=0;}}BinTreeNode;class BinTree{private: BinTreeNode *root; int maxle;public: BinTree(){ cout<
阅读全文
【数据结构上机练习】考试题目 2
摘要:代码://这个不是我的代码//链表表示集合,求两个集合交集 Intersection()#include<iostream>using namespace std;template<class T>//链表结点struct SLNode{ T data;//数据 SLNode<T> *next;//指针 SLNode(SLNode * nextNode = NULL){next = nextNode;} SLNode(const T& item, SLNode * nextNode = NULL){data = item; next = nextNo
阅读全文
【数据结构上机练习】考试题目1------好失败啊,我2分钟就改过来了
摘要:2分钟,我头脑再清醒2分钟!!!!
阅读全文
【数据结构上机练习】7. 二叉树的简单操作(2)
摘要:这次主要是用到二叉树的非递归遍历和层次遍历。孩子兄弟节点表示法保存树的结构。//============================================================================// Name : 5.1.cpp// Author : // Version :// Copyright : Your copyright notice// Description : Hello World in C++, Ansi-style//========================================...
阅读全文
浙公网安备 33010602011771号