- 博客(19)
- 收藏
- 关注
原创 c#退出窗体关闭所有线程,调整richTextBox使其总在最下边
private void mainForm_FormClosing(object sender, FormClosingEventArgs e) { try { System.Environment.Exit(0); }
2017-12-26 22:32:58 375
原创 c#线程顺序执行,并解决假死
private void Do_Pro() { foreach (Thread t in LT_Current) { a_mutex = 1; t.Start(LT_Current_Xprops); //解决Join添加后窗体假
2017-12-26 22:29:22 1601
原创 C#实现最短路径
1:迪杰斯特拉求最短路径 //迪杰斯特拉算法: /* 1.给定起点与终点,从起点开始找距离最小的点,再找距离找到点最小的(未找过的),直到找到终点 */ public static void Djstl(Graph g,int s,int e) { int[] l
2017-12-21 10:34:25 2796
原创 C#实现最小生成树
第一种: //求最小生成树,普里姆算法(Prim) //先给定一个初始点,然后找到离它最近的点,并加入找的点序列,将其对应的距离设为0 //然后找其它顶点距离新的找到点集合最小的点,再加入找到的点序列 //重复以上过程public static void Prim_MiniTree(Graph g){ //存放找到的
2017-12-20 21:55:25 1208
原创 排序
1.冒泡排序 //冒泡排序 for (int i = 0; i { for (int j = 0; j { if (adj[j, 2] > adj[j + 1, 2]) {
2017-12-20 20:50:35 110
原创 c#实现图
//先定义顶点信息,包括便签及访问记号 class Vertex { public string label; public bool visited; //构造函数用于初始化 public Vertex(string l) { this.label = l;
2017-12-19 14:42:47 615
原创 WPF课堂例子
1:界面架构有: 详细可看:https://www.cnblogs.com/mq0036/p/6232331.html2:新建一个class MyData类class MyData { private string data = "这是个模型"; public string Data
2017-12-17 14:47:33 240
转载 669. Trim a Binary Search Tree
Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might need to change the root of the tree, so the r
2017-12-16 20:04:00 101
转载 617. Merge Two Binary Trees
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.You need to merge them into a new binary tr
2017-12-16 18:23:32 82
原创 557. Reverse Words in a String III
557. Reverse Words in a String IIIGiven a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.Example
2017-12-16 17:23:49 97
原创 C#数据结构中的二叉树
class MyTree { public MyTree(char node) { Node = node; } public char Node; public MyTree lefttree; public MyTree righttree;
2017-12-14 19:36:27 218
转载 C#中的栈
转载自:https://www.cnblogs.com/leafki/p/5850784.htmlC#栈的简单介绍概 栈(Stack)代表了一个只有一个出口的后进先出的对象集合。在列表中添加一项,称为推入元素,从列表中移除一项时,称为弹出元素。 Stack 类 public class Stack : IEnumerable
2017-12-14 16:40:11 215
转载 二叉排序树的理解
转载至http://blog.csdn.net/jialeheyeshu/article/details/52343791二叉树遍历的理解如果对于上述遍历仍然不清楚可以看看下面对于二叉树的遍历理解要想彻底的理解递归就必须对程序调用子程序的过程有所了解,也就是系统对程序点的压栈和出栈操作,在主程序调用子程序的时候,系统是将子程序的入口点做压栈操作,在调用完子程序后,系统执
2017-12-14 13:47:35 142
原创 476. Number Complement
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note:The given integer is guaranteed to fit within the range
2017-12-12 14:35:35 100
原创 561. Array Partition I
Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as poss
2017-12-12 13:10:04 119
原创 728. Self Dividing Numbers
A self-dividing number is a number that is divisible by every digit it contains.For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0.Also, a self-d
2017-12-11 14:57:44 109
原创 657. Judge Route Circle
题目描述Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the original place.The move sequence is repr
2017-12-10 22:37:29 100
原创 c++中位函数
#include"bitset" //转化为二进制数的类库std::bitset bit=x; //定义bit=y;coutcout11>>i; 数字1向右移东i位,相当于除以2的i次方(x&(1 cout
2017-12-10 21:38:22 413
翻译 461. Hamming Distance
描述The Hamming distance between two integers is the number ofpositions at which the corresponding bits are different.Given two integers x and y, calculate the Hamming distance. Note:0 ≤ x
2017-12-10 00:43:55 99
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人