
算法与基础
文章平均质量分 65
ustcxjt
技术控,关注嵌入式、Linux、JAVA、mysql、分布式存储相关技术,喜欢折腾
展开
-
离散作业之无环图两点间路径数目
又是离散作业 ,无环图两点间路径数目,不指出具体路径,不判断图是否有环 Write a program that takes as input a directed acyclic graph G = (V, E) and twovertices s and t, and returns the number of paths from s to t in G. 思路:通过DF原创 2011-11-18 14:58:16 · 925 阅读 · 0 评论 -
删除字符串中重复的字符
出自CareerCup书中有错误,对于多个重复,解析不正确Design an algorithm and write code to remove the duplicate characters in a string without using any additional buffer. NOTE: One or two additional variables are fine.原创 2012-04-11 13:19:57 · 1475 阅读 · 0 评论 -
Write a method to replace all spaces in a string with ‘%20’
Write a method to replace all spaces in a string with ‘%20’./** * InterTest * cn.ustc.inter.array_string * ReplaceSpace.java * @version 1.0.0 * 2012-4-11 下午1:52:36 * Copyright (c) ustcxjt原创 2012-04-11 15:21:42 · 1765 阅读 · 0 评论 -
Coq Basic.v
形式化方法作业这里是必须完成的部分,到乘法交换律,可选部分未上传 (** * Basics: Functional Programming *) (* $Date: 2012-01-27 20:02:32 -0500 (Fri, 27 Jan 2012) $ *)(* #####################################################原创 2012-02-27 15:10:53 · 3626 阅读 · 1 评论 -
my first coq
形式化方法作业写下第一题一个好的开始 (** **** Exercise: 1 star (nandb) *)(** Complete the definition of the following function, then make sure that the [Example] assertions below each can be verified by原创 2012-02-17 23:43:07 · 928 阅读 · 0 评论 -
Coq-ProofGeneral-Emacs-Windows
主要参考https://wiki.ccs.neu.edu/display/~vkoutav/Coq-ProofGeneral-Emacs-Windows文章中有些链接失效了容易出错的地方说明下%COQBIN%\coqtop.opt.exe -top "%COQTOP%" -emacs-U在该目录下没有找到coqtop.opt.exe只有coqtop.exe修改之原创 2012-02-24 23:50:26 · 2535 阅读 · 0 评论 -
离散作业之goodguy and badguy
1. There are two types of professional wrestlers: "good guys" and "bad guys." Between any pairof professional wrestlers, there may or may not be a rivalry. Suppose we have n professionalwrestlers原创 2011-11-08 23:54:21 · 955 阅读 · 0 评论 -
离散作业之真值表
9月份的作业输入任意表达式求真值表 主要是中缀表达式-后缀表达式以及逆波兰式求解以及设计输出 //中缀表达式转换为后缀表达式,并检查是否有非法字符int trans(char *src,int *suff,int *sLen,char *var,int *vLen){ Stack s; s.ClearStack(); int i=0; int j原创 2011-11-09 00:02:11 · 1616 阅读 · 0 评论 -
离散数学之匈牙利算法
Given the following graph, find the minimum cost cover in two ways .http://hi.youkuaiyun.com/attachment/201111/18/0_13216151115Me3.gif 匈牙利算法是由匈牙利数学家Edmonds于1965年提出,因而得名。匈牙利算法是基于Hall定理中充分性证明的思想,它是部图匹配原创 2011-11-18 20:15:30 · 1410 阅读 · 0 评论 -
高效的字符串倒置
想来想去这个最高效了void reverse(char *str){ char * end=str; char tmp; if(str){ while(*end){ ++end; } --end; while(str<end){ tmp = *str; *str++ = *end; *end-- = tmp; } }}原创 2012-04-11 12:13:39 · 797 阅读 · 0 评论