![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 86
qzyf1992
这个作者很懒,什么都没留下…
展开
-
C#大整数的阶乘
现在我们拿50的阶乘举例using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 五十的阶乘{ class Program { static void Main(string[] args)原创 2013-05-18 14:01:27 · 1523 阅读 · 3 评论 -
给定一个长度为N的数组,找出一个最长的单调自增子序列(不一定连续,但是顺序不能乱). 第二解
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication2{ public class Program { private stat原创 2014-01-30 21:46:43 · 3934 阅读 · 0 评论 -
给定一个长度为N的数组,找出一个最长的单调自增子序列(不一定连续,但是顺序不能乱).
问题:给定一个长度为N的数组,找出一个最长的单调自增子序列(不一定连续,但是顺序不能乱)。例如:给定一个长度为6的数组A{5, 6, 7, 1, 2, 8},则其最长的单调递增子序列为{5,6,7,8},长度为4.分析:这里给出一种近乎求 所有的子单调序列的做法这里的序列其实可以表示为一颗树来存储 如下图 故设计如下数据结构using System;using原创 2014-01-24 14:32:48 · 5862 阅读 · 0 评论 -
树的各种遍历
using System;using System.Collections.Generic;using System.Text;namespace structure{ class Program { class nodes { T data; nodes Lnode, rn转载 2013-10-31 21:44:16 · 566 阅读 · 0 评论 -
Fibonacci数列优化
var count = 0; function fib(n) { count++; if( n < 0 ) return; if( n === 0 || n === 1) return 1; return arguments.callee(n-1) + arguments.callee(n-2); } f原创 2013-11-13 00:54:20 · 1113 阅读 · 0 评论 -
C#实现因式分解代码
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Program { static int[] nums = new int[1000]; //代表了数原创 2013-11-11 02:47:35 · 2783 阅读 · 0 评论 -
快速排序置随机数代码实现
快速排序置随机数代码实现原创 2013-11-07 23:45:23 · 994 阅读 · 0 评论 -
把一个整数划分成若干个质数的和
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Program { static int max = 0; static int原创 2013-05-12 00:27:49 · 2234 阅读 · 0 评论 -
如何用递归树求快速排序时间复杂度
用递归树的方式求快速排序的时间复杂度原创 2013-11-06 23:33:45 · 5997 阅读 · 0 评论 -
把数字转化成汉字
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Program { public static Dictionary numberTable = new Dictio原创 2013-08-03 18:38:30 · 722 阅读 · 0 评论 -
给定你一个字符串,把字符串中每个字符按不同位置打印
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Program { static List hehe = new List(); static voi原创 2013-06-11 08:34:53 · 746 阅读 · 0 评论 -
实现竖式除法
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Program { static void Main(string[] args)原创 2013-05-12 00:33:10 · 1362 阅读 · 0 评论 -
24点问题
随机4个数看是否能通过加减乘除算出24using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Program { static void Ma原创 2013-05-12 00:30:12 · 617 阅读 · 0 评论 -
0,1背包问题
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Program { public class oper {原创 2013-05-12 00:25:35 · 561 阅读 · 0 评论 -
实现计算算式字符串的2种方式(方式2)
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;namespace ConsoleApplication2{ class Program { static bool flag = true;原创 2013-05-24 02:55:36 · 723 阅读 · 0 评论 -
如果给不含引号的json字符串添加上引号
由于业务的扩张,我选择让数据人员写伪json来处理 计算数据大表到小表excel映射,现使用伪json配置映射关系。主要担心数据人员少写引号以及配置效率等问题。代码如下注释写的很清楚了.using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Thre原创 2015-04-23 13:46:44 · 6281 阅读 · 1 评论