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 <fcntl.h> | |
| #include <unistd.h> | |
| #include <sys/types.h> | |
| #define FD 100 | |
| void print_cur_pos(int fd) | |
| { |
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> | |
| #define STATION_NUMBER (6) | |
| #define START_STATION (0) | |
| char* stations[] = { "横浜", "武蔵小杉", "品川", "渋谷", "新橋", "溜池山王" }; | |
| int current_cost[STATION_NUMBER]; | |
| int fix[STATION_NUMBER]; |
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 <string.h> | |
| #define N 5 | |
| int size[N] = {2, 3, 5, 6, 9}; | |
| int value[N] = {2, 4, 7, 10, 14}; | |
| #define NAP_SIZE 16 |
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> | |
| typedef struct tagPATTERN { | |
| unsigned long hash; | |
| int pattern_from; | |
| } PATTERN; | |
| PATTERN *history; | |
| int history_count = 0; |
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> | |
| int board[8][8]; | |
| int check(int x, int y) { | |
| int p, q; | |
| for (p = 0; p < x; p++) { | |
| if (board[p][y] == 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
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #define PATTERN_LENGTH 4 | |
| unsigned char original_text[] = "On a dark desert highway, cool wind in my hair."; | |
| unsigned char original_pattern[PATTERN_LENGTH + 1 ] = "wind"; | |
| int bm_search(unsigned char *text, unsigned char *pattern) | |
| { | |
| int table[256]; |
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 <time.h> | |
| #define NOT_FOUND (-1) | |
| #define N (10) | |
| int binary_search(int x, int *a, int left, int right) | |
| { | |
| int mid; |
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 <time.h> | |
| #define N 10 | |
| int sort[N]; | |
| int buffer[N]; | |
| void mergeSort(int n, int x[]){ |
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 <time.h> | |
| #include <unistd.h> | |
| #define N 10 | |
| void bubbleSort(int num, int sort[]) | |
| { |
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 <time.h> | |
| #define N 10 | |
| int sort[N]; | |
| void quickSort(int bottom, int top, int *data) | |
| { |