This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all:rbtree-tst | |
CFLAGS=-g -O0 -Wall | |
rbtree-tst:rbtree-tst.o rbtree.o | |
rbtree.o:rbtree.h rbtree.c | |
rbtree-tst.o:rbtree-tst.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <arpa/inet.h> | |
#include <unistd.h> | |
#include <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/socket.h> | |
#include <sys/epoll.h> | |
#include <sys/types.h> | |
#include <pthread.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include "heap.h" | |
PriorityQueue pq_init(int capacity) | |
{ | |
PriorityQueue H; | |
H=(PriorityQueue )malloc(sizeof(struct HeapStruct)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Hash table. | |
This data structure is thoroughly documented in the Tour of | |
Pintos for Project 3. | |
See hash.h for basic information. */ | |
#include "hash.h" | |
#include "../debug.h" | |
#include "threads/malloc.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "list.h" | |
#include "../debug.h" | |
/* Our doubly linked lists have two header elements: the "head" | |
just before the first element and the "tail" just after the | |
last element. The `prev' link of the front header is null, as | |
is the `next' link of the back header. Their other two links | |
point toward each other via the interior elements of the list. | |
An empty list looks like this: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* netBufLib.c - network buffer library */ | |
/* Copyright 1984 - 2001 Wind River Systems, Inc. */ | |
/* | |
modification history | |
-------------------- | |
01r,07may02,kbw man page edits | |
01q,15oct01,rae merge from truestack ver 01w, base 01n (SPR #65195 etc.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* rngLib.c - ring buffer subroutine library */ | |
/* Copyright 1984-1995 Wind River Systems, Inc. */ | |
/* | |
modification history | |
-------------------- | |
01x,13feb95,jdi doc tweaks. | |
01w,20jan93,jdi documentation cleanup for 5.1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**@brief ring buffer测试程序,创建两个线程,一个生产者,一个消费者。 | |
* 生产者每隔1秒向buffer中投入数据,消费者每隔2秒去取数据。 | |
*@atuher Anker date:2013-12-18 | |
* */ | |
#include "ring_buffer.h" | |
#include <pthread.h> | |
#include <time.h> | |
#define BUFFER_SIZE 1024 * 1024 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
void merge(int a[], int temp_array[], int l_pos, int r_pos, int end) | |
{ | |
int i=0; | |
int j; | |
int l=l_pos,r=r_pos; | |
while(l<r_pos && r<=end) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "avl_tree.h" | |
static Position SingleRotateWithRight(Position K2); | |
static int Height(Position P) | |
{ | |
if(P == NULL) |