- 博客(24)
- 资源 (6)
- 收藏
- 关注
原创 python遍历字典所有的字段
def visit_dict(dt): if isinstance(dt, dict): for k in dt.keys(): if isinstance(dt[k], dict) or isinstance(dt[k], list): visit_dict(dt[k]) else:
2016-05-09 17:31:00
683
原创 二叉树C++实现
//============================================================================// Name : TreeNodeCPP.cpp// Author : zhouqinmin// Version :// Copyright : baidu// Description : Hel
2015-05-15 15:11:04
377
原创 二叉树的遍历java实现
package com.main;public interface ICollectionInterface { final int INITIAL_SIZE = 32; public boolean isEmpty(); public boolean add(T node); public T pop();}package com.main;imp
2015-05-14 16:34:06
369
原创 python基础
1.打印hello world#coding:gbkdef main(): print("hello world")if __name__ == '__main__': main()2.计算从1到100的和#coding:gbkdef calc(n): total = 0 for i in range(n): total += i return tota
2015-04-22 16:54:17
663
原创 libevent使用ndk-r8d编译
使用的是android-ndk-r8d库,使用的libevent版本号为libevent-2.0.21-stable稳定版然后是调整宏参数在event2/event-config.h中添加如下宏定义#define _EVENT_HAVE_SA_FAMILY_T 1#define _EVENT_HAVE_SYS_SOCKET_H 1#define _EVENT_HAVE_NETINE
2014-01-15 20:43:49
3655
1
转载 Android模拟器上使用NIO编写客户端中,使用select超时,立马返回0的问题
http://stackoverflow.com/questions/7450758/selector-on-android-sockets-behaves-strangely主要原因是android模拟器不支持ipv6
2013-12-19 12:04:24
634
原创 用python写的一个mp3的tag解析
最近在研究mp3的tag解析,由于涉及到编码的问题,我使用了python作为开发语言,解析了id3v2和id3v1格式的Mp3,计算时长对于定码率的mp3管用
2013-08-16 19:13:29
2131
原创 反转链表(递归和非递归实现)
// ReverseLink.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include struct Node { int data; Node* next;};void CreateLink(Node* &head,int data);
2012-09-19 10:21:56
397
原创 螺旋打印(由内向外旋)
// SpinPrint.cpp : Defines the entry point for the console application.////螺旋打印#include "stdafx.h"#include #include #include int** getCreateMatrix(int nVectors);void SpinnerPrint(int** Matrix
2012-09-19 00:59:10
947
原创 螺旋打印数组
// SpinPrint.cpp : Defines the entry point for the console application.////螺旋打印#include "stdafx.h"#include #include #include int** getCreateMatrix(int nVectors);void SpinnerPrint(int** Matrix
2012-09-18 22:48:17
482
原创 二元树中找出和为某一值的所有路径
在二元树中找出和为某一值的所有路径题目:输入一个整数和一棵二元树。从树的根结点开始往下访问一直到叶结点所经过的所有结点形成一条路径。打印出和与输入整数相等的所有路径。例如 输入整数22和如下二元树 10 / \ 5 12 / \ 4 7则打印出两条路径:10, 12和10, 5, 7。// MatrixMaxValue.cpp : Defin
2012-09-18 11:20:27
807
原创 把二元查找树转变成排序的双向链表
把二元查找树转变成排序的双向链表题目:输入一棵二元查找树,将该二元查找树转换成一个排序的双向链表。要求不能创建任何新的结点,只调整指针的指向。 10 / / 6 14/ / / /4 8 12 16 转换成双向链表4=6=8=10=12=14=16。#include using namespace std;class Node{public:
2012-09-18 00:12:33
602
原创 求一颗二叉树中叶子节点间最大的路径长度
int LongestPath(BitTree* node, int curIndex){ int m,n; if(!node) return 0; m = LongestPath(node->lChild,curIndex+1); n = LongestPath(node->rChild,curIndex+1); if(curIndex == 0) return (m+n);
2012-09-16 13:13:48
1472
原创 人人笔试1:一个人上台阶可以一次上1个,2个,或者3个,问这个人上n层的台阶,总共有几种走法?
#include #define MAXSIZE 200int Stack[MAXSIZE];int Step[] = {1,2,3};void UpStairs(int TotalSteps,int Step[],int size);int main(){ UpStairs(10,Step,sizeof(Step)/sizeof(Step[0])); return 0;
2012-09-15 21:46:25
2671
1
原创 自己实现的非递归组合
#include #include #define MAXSIZE 100#define INVALID -1int Stack[MAXSIZE];void Combination(const char ch[],int nSize,int path);int main(int argc, char* argv[]){ int i = 0; int len = 0; co
2012-09-12 00:10:01
551
原创 全排列的非递归实现
#include #include #define MAXSIZE 100#define INVALID -1int Stack[MAXSIZE];int main(int argc, char* argv[]){ int i = 0; int j = 0; int len = 0; int curIndex = 0; int findit = 0; int begi
2012-09-11 23:37:18
605
原创 自己写的非递归背包问题
#include #define N 10#define W 34int Index[N] = {0};int Stack[N] = {0};int MaxWeight = 0;int main(int argc, char* argv[]){ int weight[] = {3,2,4,5,7,8,2,4,3,2}; int Valid = -1; int top =
2012-09-11 22:18:49
366
原创 自己实现的递归背包算法
#include #define N 10#define W 19int Index[N] = {0};int Stack[N] = {0};int MaxWeight = 0;int CurrentWeight = 0;int BeiBao(int weights[],int Stack[],int nStart,int nSize,int nCount,int TotalW
2012-09-11 21:40:44
411
原创 全排列和组合的实现
#include "stdafx.h"#include #include #define MAX 100int nCount = 0;void Perm(char s[],int index[],int count,int currentCount);void Combination(char s[],int index[],int count,int currentCount,in
2012-09-09 23:08:09
756
原创 一个加减乘除的词法分析器
using System;using System.Collections.Generic;using System.Text;using System.Data;namespace SalaryCalculationProject{ /// /// 薪酬集合 /// public class SalaryItems { pr
2012-09-03 23:10:35
701
原创 具体的数据库操作类,Model类和DB类
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;namespace DBModels{ public class StudentModel { public StudentModel()
2012-08-08 20:08:54
3081
原创 数据库的逻辑层类,用一个基类进行实现
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Data.SqlClient;using System.Configuration;using System.Xml;using UtilityConsole
2012-08-08 20:02:05
1143
原创 Java中的文件操作类
import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.Objec
2012-07-29 20:55:56
322
原创 我自己的一个数据库连接类,献丑了
using System;using System.Collections.Generic;using System.Text;using System.Data.Sql;using System.Data;using System.Data.SqlClient;namespace UtilityConsole{ public delegate void ReadDataF
2012-07-29 20:46:57
335
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人