DBSCAN算法原理及实现

因为模式识别需要分组讲一个聚类算法,所以我挑选了这个算法。

阅读全文

aggressicecows

Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,...,xN (0 <= xi <= 1,000,000,000).

His C (2 <= C <= N) cows don't like this barn layout and become aggressive towards each other once put into a stall. To prevent the cows from hurting each other, FJ want to assign the cows to the stalls, such that the minimum distance between any two of them is as large as possible. What is the largest minimum distance?

阅读全文

Boolean Expressions

描述

The objective of the program you are going to produce is to evaluate boolean expressions as the one shown next:
Expression: ( V | V ) & F & ( F | V )

where V is for True, and F is for False. The expressions may include the following operators: ! for not , & for and, | for or , the use of parenthesis for operations grouping is also allowed.

To perform the evaluation of an expression, it will be considered the priority of the operators, the not having the highest, and the or the lowest. The program must yield V or F , as the result for each expression in the input file.

阅读全文

c++成员函数中static变量

我最近在做郭炜老师的编程题目,这道题我实现的过程中出现了一些蛋疼的错误,进行一个记录.

阅读全文

字典序

直接上程序:

阅读全文

C语义转换

你有没有曾经对c语言的定义苦恼?

阅读全文

排序算法小集

直接上程序

阅读全文

哈夫曼树

其实早就应该写完这个哈夫曼树,只不过最近有点没有心情学习。对于哈夫曼树的构造,我总结了以下几步:

阅读全文

stm32使用静态库

我这两天写程序的时候,使用了大量的宏定义去开启和关闭代码块。但是我发现每次我切换一个宏定义的时候就会将所以的stm32工程中的所有文件进行重新编译,耗费太长时间,效率不如之前用注释代码块的方式。所以我仔细看了看。发现每次编译stm32hal库的时间是最长的,那么我就可以将所有的hal库文件生成一个静态库,让编译的时候连接即可。

阅读全文

堆其实是也是一种二叉树,不过他的排序方式更加舒服,对于需要升序或者降序排列的数据非常有用。

阅读全文