`
ackerman
  • 浏览: 75098 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
import java.util.*; import javax.script.*; public class HelloWorld { static ScriptEngine jse = new ScriptEngineManager().getEngineByName("JavaScript"); public static void combine(List<String> list,String s, int n) { if(n==8){ list.add(s+" ...

Linux内存管理

    博客分类:
  • LDD
(1)关于Linux内存管理 http://blog.csdn.net/macrocrazier/article/details/6705298 (2)Linux内存:内存管理的实质 http://www.chinaunix.net/old_jh/4/1003872.html (3)Linux内存管理 http://www.cnblogs.com/hoys/archive/2011/09/08/2171606.html   (4)Linux设备I/O(一) http://ackerman.iteye.com/admin/blogs/939378 (5)Linux设备I/O(二) ...
  #include <stdio.h> void count_sort(int a[], int n) { int i,min,max; min=max=a[0]; for(i=0;i<n;i++) { if(a[i]>max) max=a[i]; if(a[i]<min) min=a[i]; } ...
#include <stdio.h> void merge(int a[], int tmp[],int pleft, int pright, int rightend) { int leftend=pright-1; int num=rightend-pleft+1; int pos=pleft; while(pleft<=leftend && pright<=rightend) { if(a[pleft]<=a[p ...
#include <stdio.h> void bubble_sort(int a[], int n) { int i,j,tmp; for(i=0;i<n-1;i++) for(j=0;j>n-1-i;j++) if(a[j]>a[j+1]) { tmp=a[j]; ...
#include <stdio.h> void simple_select(int a[], int n) { int i,j,k,tmp; for(i=0;i<n-1;i++) { k=i; for(j=i+1;j<n;j++) { if(a[j]<a[k]) k=j; ...
#include <stdio.h> void simple_sort(int a[], int n) { int i,j,tmp; for(i=1;i<n;i++) { tmp=a[i]; for(j=i;j>0&&tmp<a[j-1];j--) a[j]=a[j-1]; a[j]=tmp; } } void sh ...
  #include <stdio.h> void del_char(char *str, char ch) { char *p1,*p2; p1=p2=str; while(*p2!='\0'){ if(*p2!=ch) p1++; p2++; *p1=*p2; } } void del_same(char *str) { char ...
http://www.cnblogs.com/skynet/archive/2010/10/30/1865267.html #include <stdio.h> #include <stdlib.h> #include <pthread.h> int g_Flag=0; static pthread_mutex_t mutex=PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t cond=PTHREAD_COND_INITIALIZER; void * thread1(void ...
#include <stdio.h> int find(char *input_str, char *output_str) { char *p1=input_str; int max=0; int count=0; while(*p1!='\0'){ if(*p1>='0' && *p1<='9'){ char *p2=p1; while(*p2& ...

删除子字符串

#include <stdio.h> #include <string.h> int delete_sub_str(const char *str, const char *sub_str, char *result_str) { int count=0; char *p1=str; char *pos=strstr(str,sub_str); while(pos!=NULL){ count++; while(p1!=pos) ...

c语言随机数

  #include <stdio.h> #include <stdlib.h> #include <time.h> int main() { srand((unsigned)time(NULL)); //初始化随机数 /*random int number [0,a), e.g.[0,10)*/ int a1=rand()%10; /*random int number [a,b), e.g.[10,20)*/ int a2=(rand()%(20-10 ...
typedef int Item; typedef struct node { Item item; struct node *next; }Node,*List; void merge1(List la, List lb, List *lc) { Node *pa,*pb,*pc; pa=la->next; pb=lb->next; pc=(*lc)=la; while(pa && pb){ ...
  /** *链表逆序的递归/非递归算法 */ #include <stdio.h> typedef int Item; typedef struct node { Item item; struct node *next; }Node, *List; /*reverse1~2是不带头结点的逆序算法*/ List reverse1(List l) { Node *p1,*p2; if(l==NULL) return l; p1=l- ...
  #include <stdio.h> #include <string.h> void combine(char *src, char *out,int rec, int start, int end) { int i; if(start==end) return; for(i=start;i<end;i++){ out[rec]=src[i]; out[rec+1]='\0'; ...
Global site tag (gtag.js) - Google Analytics