算法
字子昂
这个作者很懒,什么都没留下…
展开
-
web挖掘之Apriori算法,java实现
博主初次接触数据挖掘方面的研究,从最经典最基础的Apriori算法编起,不过这是博主前几个月写的了,所以现在也是凭印象写的,有些粗糙,还请谅解。下面讲解部分为转载1 Apriori介绍 Apriori算法使用频繁项集的先验知识,使用一种称作逐层搜索的迭代方法,k项集用于探索(k+1)项集。首先,通过扫描事务(交易)记录,找出所有的频繁1项集,该集合记做L1,然后利用L1找频繁2转载 2018-01-03 14:59:43 · 576 阅读 · 0 评论 -
数据转换总结
1、从0到F的字符得到对应的数字,例如字符‘F’,得到数字15。int GetIntFromChar(char c){int n;if(c>='0'&&c if(c>=0x30&&cn = c - '0'; // n = c - 0x30;else if(c>='A'&&c else if(c>=0x41&&cn = c - 'A' + 10; // n = c -原创 2014-11-30 23:13:46 · 717 阅读 · 0 评论 -
链表
1、单向链表(1)创建有关指针,无头节点的单向链表:#include#includestruct LNode{ int data; struct LNode *next;};struct LNode *creat(int n){ int i; struct LNode *head,*原创 2014-02-27 10:45:08 · 855 阅读 · 0 评论 -
数据包加密和解密
加密:void EncodePacket(char *buff,size_t size){原创 2014-04-04 14:01:04 · 4031 阅读 · 0 评论 -
mylist.cpp
#include#includevoid list_tail_add(struct list_head *head,struct list_head *item){if(head == NULL || item == NULL)return;head->prev->next = item;item->prev = head->prev;head->pre原创 2014-04-02 16:52:03 · 671 阅读 · 0 评论 -
mylist.h
#ifndef _MYLIST_H#define _MYLIST_Hstruct list_head{struct list_head *prev;struct list_head *next;}//将结点插入链表尾部//head 为链表的头结点,item为要插入的新结点void list_tail_add(struct list_head *h原创 2014-04-02 16:39:58 · 829 阅读 · 0 评论 -
几个重要库函数的实现-strcpy,strncpy,memcpy,memset
面试官很喜欢让求职者写一些常用库函数的实现,有很多是和字符串相关的,有一些是关于内存拷贝的。一般,常会让写的函数有以下几个:strcpy , strncpy, memcpy。memset一般不会让去写,但这个函数也很有特点,有很多容易用错的地方。一并总结吧。1. strcpystrcpy函数的原型是:char * strcpy(char* dest, co转载 2014-04-17 19:44:04 · 954 阅读 · 0 评论 -
入口 OnReadMessage
LRESULT CGMToolDlg::OnReadMessage(WPARAM wParam,LPARAM lParam){int err;/*static link_struct *pLinkHead = NULL;static int state = 0; static int pblen =0;int nReceive = 0;char buf[原创 2014-03-10 15:56:20 · 928 阅读 · 0 评论 -
strcpy函数分析
strcpy函数实现strcpy 看似是标准函数库里面最简单的函数了,谁都可以实现这个函数, 但是,并不一定谁都能实现的很好。林锐博士面试微软的时候,就做这个题目。 他也没有把这个题目完全的做对。建议你自己先动手写一个自己的,不要先看 答案。估计有 90%的人写出来的,达不到性能的要求。 标准答案是这样的: static c转载 2014-04-17 19:31:10 · 1024 阅读 · 1 评论 -
单击列表中某一项,判断其状态
映射NM_CLICK消息,int nUpdateNoticeID =0;int nNoticeListIndex = -1;bool bIsAbleGetFocus = true;void CClassDlg::OnNMClickListNotice(NMHDR *pNMHDR,LRESULT *pResult){int temp = m_list.GetItemC原创 2014-03-17 12:03:31 · 746 阅读 · 0 评论 -
限定字符串的最大字节数
if(CStringA(m_str).GetLength()>512)return;原创 2014-03-17 17:58:49 · 884 阅读 · 0 评论 -
MFC 编辑框 限制数字输入
重写虚函数PreTranslateMessage。BOOL CClassDlg::PreTranslateMessage(MSG* pMsg){// TODO: 在此添加专用代码和/或调用基类//屏蔽小数输入框输入其他字符if(pMsg->message == WM_CHAR){ //IDC_UPPER_LIMIT和IDC_LOWER_LIMIT为编辑框IDCEdi原创 2014-03-17 18:20:50 · 3608 阅读 · 0 评论 -
将用逗号隔开的字符串存入MAP里
mapCstringToIntMap(CString strSource){mapserverIDMap;if(strSource.IsEmpty())return serverIDMap;int nFind = -1,nIndex = 0;nFind = strSource.Find(',');if(nFindserverIDMap[atoi(strSourc原创 2014-03-17 17:23:42 · 4356 阅读 · 0 评论 -
CString 字符串 按指定字符 分隔 获取第n段的子字符串
CString GetStrInSomeChar(CString strSource,CString strCh,int nGet) //第一个源字符串,第二个分隔符,第三个要获取的第几段子字符串{ CString pArray[50],str; int num; Split(strSource,pArray,num,strCh);原创 2014-01-03 10:53:35 · 2940 阅读 · 0 评论 -
std::string 在字符串中查找第n个字符的位置
int GetIndex(std::string strSource,char ch,int n){ int nIndex = -1; for(int i=1;i { nIndex++; nIndex = strSource.find(ch,nIndex);原创 2014-01-03 10:38:35 · 6173 阅读 · 0 评论