The recursive solution is trivial and I omit it here.Iterative Solution using Stack (O(n)time andO(n)space): 1 /** 2 * Definition of TreeNode: 3 * c.....
分类:
其他好文 时间:
2015-06-29 19:33:05
阅读次数:
102
说明:支持跨线程访问控件。定义代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows.Forms;using System.Threading;...
分类:
编程语言 时间:
2015-06-29 19:29:46
阅读次数:
146
using UnityEngine;using System.Collections;public class MouseEvent : MonoBehaviour { public Transform target; private float xSpeed = 250...
分类:
编程语言 时间:
2015-06-29 19:24:38
阅读次数:
294
编写一个对象,后面传递给 PropertyGrid 来显示:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.ComponentModel;namespace ...
分类:
其他好文 时间:
2015-06-29 19:20:59
阅读次数:
88
题目传送门 1 /* 2 找规律/贪心:ans = n - 01匹配的总数,水 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 const int MAX...
分类:
其他好文 时间:
2015-06-29 19:20:42
阅读次数:
115
在该双向循环链表中,表头结点first不存元素;当双向循环链表为空时:first->rlink=first->llink=first;以下代码实现了双向循环链表的插入、删除操作;在插入操作中,实现了头插法以及按序插入法。//main.cpp
//----------建立一个双向循环链表-------#include
using namespace std;
class dblis...
分类:
编程语言 时间:
2015-06-29 17:15:36
阅读次数:
210
以下只是对此问题的一个代码实现,具体理论部分请参见王晓东《算法设计与分析》第2版3.1节 矩阵连乘问题。
#include
#include
using namespace std;
#define MAX_COUNT 20
//矩阵属性
struct tagMatrixAttribute
{
int row;
int col;
};
//矩阵连乘加括号求解
void Ma...
分类:
其他好文 时间:
2015-06-29 17:12:26
阅读次数:
144
问题:若一个口袋中放有12个球,3红3白和6黑,问从袋中任意取8个球,有多少种不同的颜色搭配?
using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(...
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using System.Wind...
The recursive solution is trivial and I omit it here.Iterative Solution using Stack (O(n) time and O(n) space): 1 /** 2 * Definition of TreeNode: 3 .....
分类:
其他好文 时间:
2015-06-29 16:17:05
阅读次数:
106