折半查找(数组) #include<iostream>using namespace std;int Search(int n[],int s){ int low = 0, high = 9, mid; while (low <= high) { mid = (low + high) / 2; if (n[mid] == s) return mid; else if (n[mid] > s) high = mid - 1; else low = mid
图的定义,遍历操作 #include<iostream>#define MaxVertexNum 100using namespace std;typedef struct { char Vex[MaxVertexNum];//顶点表 int Edge[MaxVertexNum][MaxVertexNum];//邻接矩阵 int vexnum, arcnum;//顶点数,弧数}MGraph;typedef struct ArcNode {//边表结点 int adjvex;//弧指向顶点的
栈的遍历(递归) #include<iostream>#define MaxSize 50using namespace std;typedef struct BiTNode { int data; struct BiTNode* lchild, * rchild;}BiTNode,*BiTree;typedef struct Queue { int front, rear; int data[MaxSize];}Queue;void visit(BiTNode* T);void Init
栈的括号匹配 #include<iostream>#define MaxSize 50using namespace std;typedef struct { char data[MaxSize]; int top;}SqStack;void InitStack(SqStack& S){ S.top = -1;}bool Push(SqStack& S,char x){ if (S.top == MaxSize - 1) return false; S.da
循环队列基本操作 #include<iostream>#define MaxSize 50using namespace std;typedef struct { int data[MaxSize]; int front, rear;}SqQueue;void InitQueue(SqQueue& Q){ Q.rear = Q.front = 0;}bool isEmpty(SqQueue& Q){ if (Q.rear = Q.front) return true
顺序栈基本操作 #include<iostream>#define MaxSize 50using namespace std;typedef struct { int data[MaxSize]; int top;}SqStack;void InitStack(SqStack& S){ S.top = -1;}bool StackEmpty(SqStack& S){ if (S.top == -1) return true; else return fals
链表基本操作 #include<iostream>using namespace std;typedef struct LNode { int data; struct LNode* next;}LNode,*LinkList;//带头结点头插法LinkList HeadInSert(LinkList& L){ LNode* p; int x; cin >> x; L = (LinkList)malloc(sizeof(LNode)); L->next
顺序表基本操作 #include<iostream>#define MaxSize 50using namespace std;typedef int Elemtype;typedef struct { int data[MaxSize]; int length;}SqList;void InitList(SqList& L){ for (int i = 0; i < MaxSize; i++) L.data[i] = 0; L.length = 0;}void
一元多项式表示相加 例子:A=7+3x+9x8+5x17A = 7+3x+9x^8+5x^17A=7+3x+9x8+5x17B=8x+22x7−9x8B = 8x+22x^7-9x^8B=8x+22x7−9x8#include <iostream>#include <malloc.h>using namespace std;typedef struct Term{ float coef;//x前面的系数 int expn; //x的次方数 struct Term *next;}
3D柴犬旋转相册 3D柴犬旋转相册(一心想成为铲屎官的我,看到这个网上的教程就立马做了个,嘿嘿嘿)首先三个文件放在一个文件夹里html代码如下<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <title>css-3d旋转</title> <link rel="stylesheet" href="css/style.css" /> </head>
css水平与垂直导航栏 css水平与垂直导航栏理解皆在代码中水平:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style>
Html5将视频设置为背景并加上音频 Html5将视频设置为背景<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> vide
利用css设置背景图片(一张图片) 利用css设置背景图片<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style type="text/css">