数据结构大型实验的记录(done)
用平衡二叉树的知识实现用户登录系统模拟
基本思路:
类:AVLnode (树的节点类)
AVLtree (树的基本操作类 包括insert remove search 平衡树的4种旋转)
UserInfo(用户信息类)
决定还是按日期更新 这样更完整一点
12-15
昨天写到12点多,基本写完了AVL类,删除部分还有待完善,之后可能要补充平衡过程。
昨天写完类后想到具体的用户交互过程,想到一个节点里不仅要存用户名还要存密码,然后之前写类的时候一直是当一个nodeValue来写的,写到头昏脑胀有点晕以为要重新写一遍把nodeValue更新到两个了。今天想到了很简单的解决办法,只要在AVLnode类里加一个string password然后在每次insert完后返回insert的节点,再用节点指向它的password就可以了。
初步做了交互界面。
不是数据的问题,insert方法本身就有问题 可能不只是旋转上的错误
apple fhy1118
Apple 1110111
abc ABC4C
Aabc1 **2
cat 890
but happy
flower flower
trees 5678910
flowst 9087
but1 000000
flowar 080808
12-16
尼玛挑了半天旋转 本来没问题的都快被我调成有问题的了。格式也超优化 结果发现是insert里面p往上遍历写错
for(int i=0;i<count-2;i++)
p=newnode->parent;
发现的时候心中真的千万匹草泥马开始奔腾啊!!!!!!
但是成功构建以后很爽!!!!!!!
这尼玛大概就是程序猿的痛并快乐着了吧!!!!!!!!!!
贴上完整代码!!!
- // AVLnode.h: interface for the AVLnode class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_AVLNODE_H__C8E651E6_0EA9_4808_848B_0CB927923FAE__INCLUDED_)
- #define AFX_AVLNODE_H__C8E651E6_0EA9_4808_848B_0CB927923FAE__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include <stddef.h>
- #include <string>
- using namespace std;
- class AVLnode
- {
- public:
- string nodeValue;// node data
- string password;
- AVLnode *left, *right, *parent; // child pointers and pointer to the node's parent
- AVLnode (const string item, AVLnode *lptr=NULL, AVLnode *rptr=NULL, AVLnode *pptr=NULL):
- nodeValue(item), left(lptr), right(rptr), parent(pptr)
- {}
- public:
- AVLnode(){password="";};
- virtual ~AVLnode(){};
- };
- #endif // !defined(AFX_AVLNODE_H__C8E651E6_0EA9_4808_848B_0CB927923FAE__INCLUDED_)
AVLnode.h
- // AVLtree.h: interface for the AVLtree class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_AVLTREE_H__36B69688_6A87_4949_A008_13138B14D185__INCLUDED_)
- #define AFX_AVLTREE_H__36B69688_6A87_4949_A008_13138B14D185__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "AVLnode.h"
- #include "tnodeShadow.h"
- #include <iostream>
- #include <iomanip>
- using namespace std;
- class AVLtree
- {
- public:
- AVLtree(); // constructor. initialize root to NULL and size to 0
- ~AVLtree(); // destructor
- tnodeShadow *buildShadowTree(AVLnode *t, int level, int& column);
- void displayTree(int maxCharacters);
- void deleteShadowTree(tnodeShadow *t);
- AVLnode *insert(const string &item);
- void remove(const string &item);
- AVLnode *search(const string &item) const;
- AVLnode *getRoot();
- private:
- AVLnode *root; // pointer to tree root
- int treeSize; // number of elements in the tree
- AVLnode *creatAVLNode(const string item, AVLnode *lptr, AVLnode *rptr, AVLnode *pptr);
- int depth(AVLnode *p)
- {
- int ldep=,rdep=,depval;
- if(p==NULL)
- depval=-;
- else
- {
- ldep=depth(p->left);
- rdep=depth(p->right);
- depval=+(ldep>rdep?ldep:rdep);
- }
- return depval;
- };
- int balanceFactor(AVLnode *cur)
- {
- int ldep=,rdep=;
- AVLnode *p=cur;
- ldep=depth(p->left);
- rdep=depth(p->right);
- return (rdep-ldep);
- };
- void rightRotate(AVLnode *cur)
- {
- //cur is the middle one
- if(cur->right!=NULL)
- {
- cur->parent->left=cur->right;
- cur->right->parent=cur->parent;
- }
- else cur->parent->left=NULL;
- if(cur->parent->parent==NULL)
- {
- cur->parent->parent=cur;
- cur->right=cur->parent;
- cur->parent=NULL;
- root=cur;
- }
- else
- {
- AVLnode *pr=cur->parent->parent;
- cur->right=cur->parent;
- cur->parent->parent=cur;
- cur->parent=pr;
- if(cur->nodeValue>pr->nodeValue)
- pr->right=cur;
- else pr->left=cur;
- }
- };
- void leftRotate(AVLnode *cur)
- {
- //cur is the middle one
- if(cur->left!=NULL)
- {
- cur->parent->right=cur->left;
- cur->left->parent=cur->parent;
- }
- else cur->parent->right=NULL;
- if(cur->parent->parent==NULL)
- {
- cur->parent->parent=cur;
- cur->left=cur->parent;
- cur->parent=NULL;
- root=cur;
- }
- else
- {
- AVLnode *pr=cur->parent->parent;
- cur->left=cur->parent;
- cur->parent->parent=cur;
- cur->parent=pr;
- if(cur->nodeValue>pr->nodeValue)
- pr->right=cur;
- else pr->left=cur;
- }
- };
- void leftrightRotate(AVLnode *cur)
- {
- //cur is the third one
- //全空
- if(cur->left==NULL&&cur->right==NULL)
- {
- cur->parent->right=NULL;
- cur->parent->parent->left=NULL;
- }
- //一边空 另一边最多一个
- else if(cur->right==NULL)
- {
- cur->left->parent=cur->parent;
- cur->parent->right=cur->left;
- cur->parent->parent->left=NULL;
- }
- else if(cur->left==NULL)
- {
- cur->right->parent=cur->parent->parent;
- cur->parent->parent->left=cur->right;
- cur->parent->right=NULL;
- }
- //非空 挂在一边 另一边最多只有一个元素
- else
- {
- cur->left->parent=cur->parent;
- cur->parent->right=cur->left;
- cur->right->parent=cur->parent->parent;
- cur->parent->parent->left=cur->right;
- }
- AVLnode *pr=cur->parent->parent->parent;
- cur->right=cur->parent->parent;
- cur->parent->parent->parent=cur;
- cur->parent->parent=cur;
- cur->left=cur->parent;
- if(pr!=NULL)
- {
- cur->parent=pr;
- if(cur->nodeValue<pr->nodeValue)
- pr->left=cur;
- else pr->right=cur;
- }
- else
- {
- cur->parent=NULL;
- root=cur;
- }
- };
- void rightleftRotate(AVLnode *cur)
- {
- //cur is the third one
- //全空
- if(cur->left==NULL&&cur->right==NULL)
- {
- cur->parent->left=NULL;
- cur->parent->parent->right=NULL;
- }
- //一边空 另一边最多一个
- else if(cur->left==NULL)
- {
- cur->right->parent=cur->parent;
- cur->parent->left=cur->right;
- cur->parent->parent->right=NULL;
- }
- else if(cur->right==NULL)
- {
- cur->left->parent=cur->parent->parent;
- cur->parent->parent->right=cur->left;
- cur->parent->left=NULL;
- }
- //非空 挂在一边 另一边最多只有一个元素
- else
- {
- cur->right->parent=cur->parent;
- cur->parent->left=cur->right;
- cur->left->parent=cur->parent->parent;
- cur->parent->parent->right=cur->left;
- }
- AVLnode *pr=cur->parent->parent->parent;
- cur->left=cur->parent->parent;
- cur->parent->parent->parent=cur;
- cur->parent->parent=cur;
- cur->right=cur->parent;
- if(pr!=NULL)
- {
- cur->parent=pr;
- if(cur->nodeValue<pr->nodeValue)
- pr->left=cur;
- else pr->right=cur;
- }
- else
- {
- cur->parent=NULL;
- root=cur;
- }
- }
- };
- #endif // !defined(AFX_AVLTREE_H__36B69688_6A87_4949_A008_13138B14D185__INCLUDED_)
AVLtree.h
- // menu.h: interface for the menu class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_MENU_H__A58647F3_F271_4C38_8097_A38DF9CA38CF__INCLUDED_)
- #define AFX_MENU_H__A58647F3_F271_4C38_8097_A38DF9CA38CF__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "AVLtree.h"
- #include <fstream>
- #include <stack>
- using namespace std;
- class menu
- {
- public:
- menu();
- virtual ~menu();
- void select();
- void menuInsert();
- void menuLogin();
- void menulogsuccess(AVLnode *login);
- void menuChange(AVLnode *login);
- void menuDelete(AVLnode *login);
- void menuexit();
- private:
- AVLtree tree;
- };
- #endif // !defined(AFX_MENU_H__A58647F3_F271_4C38_8097_A38DF9CA38CF__INCLUDED_)
menu.h
- // menu.cpp: implementation of the menu class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "menu.h"
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- menu::menu()
- {
- ifstream f;
- f.open("1.txt");
- string id,pass;
- while(!f.eof())
- {
- f>>id>>pass;
- AVLnode *t=tree.insert(id);
- t->password=pass;
- }
- f.close();
- }
- menu::~menu()
- {
- }
- void menu::select()
- {
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<" welcome \n";
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<" 1.注册账号 \n\n";
- cout<<" 2.登录账号 \n\n";
- cout<<" 3.退 出 \n\n";
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<"输入数字进行选择:";
- int choice;
- cin>>choice;
- if(choice==)
- menuInsert();
- if(choice==)
- menuLogin();
- else
- menuexit();
- }
- void menu::menuInsert()
- {
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<" 注册账号 \n";
- cout<<"--------------------------------------------------------------------------------\n";
- bool exist=true;
- string userId;
- string npassword;
- while(exist)
- {
- cout<<"请输入账号: ";
- cin>>userId;
- AVLnode *judge=tree.search(userId);
- if(judge==NULL) exist=false;
- else cout<<"您输入的用户名已存在!\n";
- }
- AVLnode *cur=tree.insert(userId);
- cout<<"请输入密码: ";
- cin>>npassword;
- cur->password=npassword;
- menuexit(); //更新注册后的用户信息 否则删除出错。
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<" 注册成功! \n";
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<"按1键返回上层...";
- int num;
- cin>>num;
- if(num==)
- select();
- else
- menuexit();
- }
- void menu::menuLogin()
- {
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<" 登录账号 \n";
- cout<<"--------------------------------------------------------------------------------\n";
- string userId;
- string npassword;
- cout<<"请输入账号: ";
- cin>>userId;
- cout<<"请输入密码: ";
- cin>>npassword;
- AVLnode *login=tree.search(userId);
- if(login==NULL)
- {
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<" 您输入的账号不存在! \n";
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<"按下1键重新输入...\n";
- int num;
- cin>>num;
- if(num==)
- menuLogin();
- else
- menuexit();
- }
- else
- {
- if(login->password==npassword)
- menulogsuccess(login);
- else
- {
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<" 密码错误! \n";
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<"按下1键重新输入...";
- int num;
- cin>>num;
- if(num==)
- menuLogin();
- else
- menuexit();
- }
- }
- }
- void menu::menulogsuccess(AVLnode *login)
- {
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<" 登录成功! \n";
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<" 1.修改密码 \n\n";
- cout<<" 2.删除账号 \n\n";
- cout<<" 3.回主菜单 \n\n";
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<"输入数字进行选择:";
- int choice;
- cin>>choice;
- if(choice==) select();
- if(choice==)
- menuChange(login);
- if(choice==)
- menuDelete(login);
- else
- menuexit();
- }
- void menu::menuChange(AVLnode *login)
- {
- cout<<"请输入新密码: ";
- string npassword;
- cin>>npassword;
- cout<<"请再次输入新密码: ";
- string check;
- cin>>check;
- if(check==npassword)
- {
- login->password=npassword;
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<" 修改成功! \n";
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<"按下1键返回登录...";
- int num;
- cin>>num;
- if(num==)
- menuLogin();
- else
- menuexit();
- }
- else
- {
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<" 两次输入不一致! \n";
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<"按下1键返回修改 2键返回登录界面...";
- int num;
- cin>>num;
- if(num==)
- menuChange(login);
- else if(num==)
- menulogsuccess(login);
- else menuexit();
- }
- }
- void menu::menuDelete(AVLnode *login)
- {
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<" 确认删除? \n";
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<"按下1键确认 2键返回初始界面...";
- int num;
- cin>>num;
- if(num==)
- {
- tree.remove(login->nodeValue);
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<" 删除成功! \n";
- cout<<"--------------------------------------------------------------------------------\n";
- cout<<"按下1键返回初始界面...";
- int n;
- cin>>n;
- if(n==)
- select();
- else
- menuexit();
- }
- else if(num==)
- select();
- else menuexit();
- }
- void menu::menuexit()
- {
- ofstream f;
- f.open("1.txt");
- string id,pass;
- stack<AVLnode*> s;
- AVLnode *p=tree.getRoot();
- while(p!=NULL||!s.empty())
- {
- while(p!=NULL)
- {
- s.push(p);
- p=p->left;
- }
- if(!s.empty())
- {
- p=s.top();
- id=p->nodeValue;
- pass=p->password;
- f<<id<<" "<<pass<<"\n";
- s.pop();
- p=p->right;
- }
- }
- f.flush();
- f.close();
- }
menu.cpp
- #include "AVLnode.h"
- #include "AVLtree.h"
- #include "menu.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- menu guest;
- guest.select();
- return ;
- }
main.cpp
- // AVLtree.cpp: implementation of the AVLtree class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "AVLtree.h"
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- AVLtree::AVLtree()
- {
- root=NULL;
- treeSize=;
- }
- AVLtree::~AVLtree()
- {
- }
- AVLnode *AVLtree::getRoot()
- {
- return root;
- }
- AVLnode *AVLtree::creatAVLNode (const string item, AVLnode *lptr, AVLnode *rptr, AVLnode *pptr)
- {
- AVLnode *newNode;
- // initialize the data and all pointers
- newNode = new AVLnode (item, lptr, rptr, pptr);
- return newNode;
- }
- void AVLtree::displayTree(int maxCharacters)
- {
- string label;
- int level = , column = ;
- int colWidth = maxCharacters + ;
- int currLevel = , currCol = ;
- if (treeSize == )
- return;
- tnodeShadow *shadowRoot = buildShadowTree(root, level, column);
- tnodeShadow *currNode;
- queue<tnodeShadow *> q;
- q.push(shadowRoot);
- while(!q.empty())
- {
- currNode = q.front();
- q.pop();
- if (currNode->level > currLevel)
- {
- currLevel = currNode->level;
- currCol = ;
- cout << endl;
- }
- if(currNode->left != NULL)
- q.push(currNode->left);
- if(currNode->right != NULL)
- q.push(currNode->right);
- if (currNode->column > currCol)
- {
- cout << setw((currNode->column-currCol)*colWidth) << " ";
- currCol = currNode->column;
- }
- cout << setw(colWidth) << currNode->nodeValueStr;
- currCol++;
- }
- cout << endl;
- deleteShadowTree(shadowRoot);
- }
- void AVLtree::deleteShadowTree(tnodeShadow *t)
- {
- if (t != NULL)
- {
- deleteShadowTree(t->left);
- deleteShadowTree(t->right);
- delete t;
- }
- }
- AVLnode *AVLtree::insert(const string &item)
- {
- AVLnode *t=root,*newnode,*parent=NULL;
- while(t!=NULL)
- {
- parent=t;
- if(item==t->nodeValue)
- return NULL;
- else if(item<t->nodeValue)
- t=t->left;
- else
- t=t->right;
- }
- newnode=creatAVLNode(item,NULL,NULL,parent);
- if(parent==NULL)
- root=newnode;
- else if(item>parent->nodeValue)
- parent->right=newnode;
- else
- parent->left=newnode;
- treeSize++;
- int bf=,count=;
- AVLnode *cur=newnode,*p=newnode;
- while(bf>=-&&bf<=&&cur!=root)
- {
- cur=cur->parent;
- count++;
- bf=balanceFactor(cur);
- }
- if(bf<-||bf>)
- {
- if(count==) ;
- else
- {
- for(int i=;i<count-;i++)
- p=p->parent;
- }
- //all left
- if(p->nodeValue<p->parent->nodeValue&&p->parent->nodeValue<cur->nodeValue)
- rightRotate(p->parent);
- //all right
- else if(p->nodeValue>p->parent->nodeValue&&p->parent->nodeValue>cur->nodeValue)
- leftRotate(p->parent);
- //right left
- else if(p->nodeValue<p->parent->nodeValue&&p->parent->nodeValue>cur->nodeValue)
- rightleftRotate(p);
- //left right
- else if(p->nodeValue>p->parent->nodeValue&&p->parent->nodeValue<cur->nodeValue)
- leftrightRotate(p);
- }
- return newnode;
- }
- void AVLtree::remove(const string &item)
- {
- AVLnode *t=search(item);
- if(t==NULL) return;
- //leaf node
- else if(t->left==NULL&&t->right==NULL)
- {
- if(t==root)
- root=NULL;
- else if(t->nodeValue>t->parent->nodeValue)
- t->parent->right=NULL;
- else
- t->parent->left=NULL;
- }
- //only left or right
- else if(t->left==NULL)
- {
- if(t==root)
- {
- t->right->parent=NULL;
- root=t->right;
- }
- else if(t->nodeValue>t->parent->nodeValue)
- t->parent->right=t->right;
- else
- t->parent->left=t->right;
- t->right->parent=t->parent;
- }
- else if(t->right==NULL)
- {
- if(t==root)
- {
- t->left->parent=NULL;
- root=t->left;
- }
- else if(t->nodeValue>t->parent->nodeValue)
- t->parent->right=t->left;
- else
- t->parent->left=t->left;
- t->left->parent=t->parent;
- }
- //left && right
- else
- {
- AVLnode *r=t;
- if(t==root)
- {
- r=r->right;
- while(r->left!=NULL)
- r=r->left;
- r->left=t->left;
- t->left->parent=r;
- if(r->right==NULL&&r->parent!=root)
- {
- r->right=t->right;
- t->right->parent=r;
- r->parent->left=NULL;
- }
- else if(r->parent!=root)
- {
- r->parent->left=r->right;
- r->right->parent=r->parent;
- r->right=t->right;
- t->right->parent=r;
- }
- r->parent=NULL;
- root=r;
- }
- else if(t->nodeValue>t->parent->nodeValue)
- {
- r=r->right;
- while(r->left!=NULL)
- r=r->left;
- if(r->parent!=t)
- {
- if(r->right==NULL)
- r->parent->left=NULL;
- else
- {
- r->right->parent=r->parent;
- r->parent->left=r->right;
- }
- r->right=t->right;
- t->right->parent=r;
- r->parent=t->parent;
- t->parent->right=r;
- r->left=t->left;
- t->left->parent=r;
- }
- else
- {
- r->parent=t->parent;
- t->parent->right=r;
- r->left=t->left;
- t->left->parent=r;
- }
- }
- else
- {
- r=r->right;
- while(r->left!=NULL)
- r=r->left;
- if(r->parent!=t)
- {
- if(r->right==NULL)
- r->parent->left=NULL;
- else
- {
- r->right->parent=r->parent;
- r->parent->left=r->right;
- }
- r->right=t->right;
- t->right->parent=r;
- r->parent=t->parent;
- t->parent->left=r;
- r->left=t->left;
- t->left->parent=r;
- }
- else
- {
- r->parent=t->parent;
- t->parent->left=r;
- r->left=t->left;
- t->left->parent=r;
- }
- }
- }
- treeSize--;
- delete t;
- //平衡部分
- }
- AVLnode *AVLtree::search(const string &item) const
- {
- AVLnode *t=root;
- while(t!=NULL)
- {
- if(t->nodeValue==item) return t;
- else if(item<t->nodeValue)
- t=t->left;
- else t=t->right;
- }
- return NULL;
- }
- tnodeShadow *AVLtree::buildShadowTree(AVLnode *t, int level, int& column)
- {
- tnodeShadow *newNode = NULL;
- char text[];
- ostrstream ostr(text,);
- if (t != NULL)
- {
- newNode = new tnodeShadow;
- tnodeShadow *newLeft = buildShadowTree(t->left, level+, column);
- newNode->left = newLeft;
- ostr << t->nodeValue << ends;
- newNode->nodeValueStr = text;
- newNode->level = level;
- newNode->column = column;
- column++;
- tnodeShadow *newRight = buildShadowTree(t->right, level+, column);
- newNode->right = newRight;
- }
- return newNode;
- }
AVLtree.cpp
附调试时用的结构化打印树的函数
- // tnodeShadow.h: interface for the tnodeShadow class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_TNODESHADOW_H__18034BAE_051F_4D57_91FF_BE10AFD37CDA__INCLUDED_)
- #define AFX_TNODESHADOW_H__18034BAE_051F_4D57_91FF_BE10AFD37CDA__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include <iomanip> // for setw()
- #include <strstream> // for format conversion
- #include <string> // node data formatted as a string
- #include <queue>
- #include <utility>
- using namespace std;
- class tnodeShadow
- {
- public:
- string nodeValueStr; // formatted node value
- int level,column;
- tnodeShadow *left, *right;
- tnodeShadow ()
- {}
- };
- #endif // !defined(AFX_TNODESHADOW_H__18034BAE_051F_4D57_91FF_BE10AFD37CDA__INCLUDED_)
tnodeShadow.h
第一次写这么完整的程序 运行的一刻真的好爽!
数据结构大型实验的记录(done)的更多相关文章
- 20172328《程序设计与数据结构》实验三 敏捷开发与XP实践报告
20172328<程序设计与数据结构>实验三 敏捷开发与XP实践报告 课程:<程序设计与数据结构> 班级: 1723 姓名: 李馨雨 学号:20172328 实验教师:王志强 ...
- 20172310 2017-2018-2 《程序设计与数据结构》实验三报告(敏捷开发与XP实践)
20172310 2017-2018-2 <程序设计与数据结构>实验三报告(敏捷开发与XP实践) 课程:<程序设计与数据结构> 班级: 1723 姓名: 仇夏 学号:20172 ...
- 20172301 《Java软件结构与数据结构》实验三报告
20172301 <Java软件结构与数据结构>实验三报告 课程:<Java软件结构与数据结构> 班级: 1723 姓名: 郭恺 学号:20172301 实验教师:王志强老师 ...
- 20172328《程序设计与数据结构》实验四 Android程序设计报告
20172328<程序设计与数据结构>实验四 Android程序设计报告 课程:<程序设计与数据结构> 班级: 1723 姓名: 李馨雨 学号:20172328 实验教师:王志 ...
- 20172301 《Java软件结构与数据结构》实验二报告
20172301 <Java软件结构与数据结构>实验二报告 课程:<Java软件结构与数据结构> 班级: 1723 姓名: 郭恺 学号:20172301 实验教师:王志强老师 ...
- 20172329 2018-2019 《Java软件结构与数据结构》实验三报告
20172329 2018-2019-2 <Java软件结构与数据结构>实验三报告 课程:<Java软件结构与数据结构> 班级: 1723 姓名: 王文彬 学号:2017232 ...
- 20172329 2018-2019-2 《Java软件结构与数据结构》实验二报告
20172329 2018-2019-2 <Java软件结构与数据结构>实验二报告 课程:<Java软件结构与数据结构> 班级: 1723 姓名: 王文彬 学号:2017232 ...
- 20172301 2017-2018-2 《程序设计与数据结构》实验一《Java开发环境的熟悉》实验报告
20172301 2017-2018-2 <程序设计与数据结构>实验一<Java开发环境的熟悉>实验报告 课程:<程序设计与数据结构> 班级: 1723 姓名: 郭 ...
- 20172301 《Java软件结构与数据结构》实验一报告
20172301 <Java软件结构与数据结构>实验一报告 课程:<Java软件结构与数据结构> 班级: 1723 姓名: 郭恺 学号:20172301 实验教师:王志强老师 ...
随机推荐
- iOS:原生二维码扫描
做iOS的二维码扫描,有两个第三方库可以选择,ZBar和ZXing.今天要介绍的是iOS7.0后AVFoundation框架提供的原生二维码扫描. 首先需要添加AVFoundation.framewo ...
- mapreduce 关于小文件导致任务缓慢的问题
小文件导致任务执行缓慢的原因: 1.很容易想到的是map task 任务启动太多,而每个文件的实际输入量很小,所以导致了任务缓慢 这个可以通过 CombineTextInputFormat,解决,主要 ...
- centos6.5安装vsftpd
开通FTP有gssftp和vsftpd二种,查了查,据说vsftpd更稳定和更安全.就用vsftpd吧. 什么是vsftpd vsftpd是一款在Linux发行版中最受推崇的FTP服务器程序.特点是小 ...
- [LeetCode]题解(python):087-Scramble String
题目来源: https://leetcode.com/problems/scramble-string/ 题意分析: 给定一个字符串,字符串展成一个二叉树,如果二叉树某个或多个左右子树颠倒得到的新字符 ...
- 关于document.selection和TextRange对象的介绍
document.selection只有IE支持 window.getSelection()也只有FireFox和Safari支持,都不是标准语法. selection 对象代表了当前激活选中区,即高 ...
- python OptionParser模块
Python中强大的选项处理模块. #!/usr/bin/python from optparse import OptionParser parser = OptionParser() parser ...
- HDU 2108 Shape of HDU
题解:按照输入顺序依次将点连接起来,对于连续的三个点p0,p1,p2,令向量a=p1-p0,b=p2-p1 若是凸多边形,那么b相对于a一定是向逆时针方向旋转的 判断两向量的旋转方向,可以使用向量的叉 ...
- Sicily-1028
一. 题意: 算出汉诺塔移动序列中对应位置的号码,数据规模很大,所以不能单纯递归,而是要找出汉诺塔序列的规律. 二. 汉诺塔数列 为了得出最少的移动步数,当n为偶数时,最上 ...
- Curling 2.0(dfs回溯)
Curling 2.0 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 15567 Accepted: 6434 Desc ...
- 1148 - Mad Counting(数学)
1148 - Mad Counting PDF (English) Statistics Forum Time Limit: 0.5 second(s) Memory Limit: 32 MB M ...