随笔 - 149  文章 - 8  评论 - 248  阅读 - 21万

随笔分类 -  数据结构算法

数据结构算法
RSA 在C#里简单实现
摘要:1.选择两个大素数:p,q;2.计算所得n:n=p*q;3.计算中间结果t:t=(p-1)*(q-1);4.选择一个e:要求e和t的最大公因数是1(也就是e与t互素);5.计算所得d:d*e mod t=1,就是说要求d和e的乘积除以t余1;(n,e)就是公钥,(n,d)就是私钥 using Sys 阅读全文
posted @ 2017-08-22 16:33 几度夕阳红了 阅读(1387) 评论(0) 推荐(0) 编辑
稀疏矩阵的操作实现
摘要:[代码] 阅读全文
posted @ 2010-10-29 11:48 几度夕阳红了 阅读(2005) 评论(0) 推荐(0) 编辑
猴子报数选大王
摘要:题目:n只猴子要选大王,选举办法如下:所有猴子按1,2,…,n编号围坐一圈,从第1号开始按1,2,…m报数,凡报到m号的退出到圈外,如此循环报数,直到圈内剩下最后一只猴子时,这只猴子就是大王,n和m由键盘输入,打印出最后剩下的猴子号。分析:用一个含有n个元素的一维数组a来存储猴子的编号,初始时a[i]存放的是猴子的编号i。开始时,从a[0]开始报数,用count来表示报... 阅读全文
posted @ 2010-10-28 21:15 几度夕阳红了 阅读(807) 评论(0) 推荐(0) 编辑
KMP算法
摘要:KMP算法的关键在于模式字符串的处理,就是如何求next数组的值我以为关键点就在于就是要找到k的值ababacde如果到最后一个a的话,最前面的ab和最后一个a前面的ab相等,所以k为2abacacde如果到最后一个a的话,a前面的c,在abac里中,没有字符满足,所以就是0 阅读全文
posted @ 2010-10-27 12:20 几度夕阳红了 阅读(206) 评论(0) 推荐(0) 编辑
线性表中的顺序表的各种操作
摘要:代码 阅读全文
posted @ 2010-10-23 17:20 几度夕阳红了 阅读(419) 评论(0) 推荐(0) 编辑
编写打印出一个单链表的所有元素的程序
摘要://Building a linked list in C//The following program shows how a simple, linear linked list can be constructed in C, using dynamic memory allocation and pointers. #include "stdafx.h"#include<stdlib... 阅读全文
posted @ 2010-10-23 16:17 几度夕阳红了 阅读(4772) 评论(0) 推荐(0) 编辑
Knapsack problem(背包问题)
摘要:The knapsack problem or rucksack problem is a problem in combinatorial optimization: Given a set of items, each with a weight and a value, determine the number of each item to include in a collection ... 阅读全文
posted @ 2010-10-06 11:55 几度夕阳红了 阅读(1127) 评论(0) 推荐(0) 编辑
汉诺塔问题
摘要:汉诺塔Demo PageThe Tower of Hanoi or Towers of Hanoi is a mathematical game or puzzle. It consists of three rods, and a number of disks of different sizes which can slide onto any rod. The puzzle starts ... 阅读全文
posted @ 2010-10-01 21:55 几度夕阳红了 阅读(401) 评论(1) 推荐(0) 编辑
8皇后和N皇后问题
摘要:The eight queens puzzle is the problem of placing eight chess queens on an 8×8 chessboard such that none of them are able to capture any other using the standard chess queen's moves. The queens ... 阅读全文
posted @ 2010-10-01 20:39 几度夕阳红了 阅读(364) 评论(0) 推荐(0) 编辑
常用算法总结
摘要:取两个数组中不相等的部分 阅读全文
posted @ 2010-03-11 11:32 几度夕阳红了 阅读(243) 评论(0) 推荐(0) 编辑
c#算法-快速排序
摘要:CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System;using System.Collections.Generic;using System.Text;namespace SortAlgorithm{ class ... 阅读全文
posted @ 2009-03-14 19:52 几度夕阳红了 阅读(400) 评论(0) 推荐(0) 编辑
c#算法-选择排序
摘要:CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System;using System.Collections.Generic;using System.Text;namespace SortAlgorithm{ class ... 阅读全文
posted @ 2009-03-14 19:51 几度夕阳红了 阅读(345) 评论(0) 推荐(0) 编辑
c#算法-冒泡排序
摘要:CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System;using System.Collections.Generic;using System.Text;namespace SortAlgorithm{ class ... 阅读全文
posted @ 2009-03-14 19:50 几度夕阳红了 阅读(388) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示