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> | |
| struct DynamicArray { | |
| int* arr; | |
| unsigned short size, cursor; //To track cursor's position | |
| }; | |
| int main() { | |
| struct DynamicArray arrays[3] = {NULL, 0, 0}; | |
| unsigned short i, j; //Loop counters |
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> | |
| int fibonacci (int n); // Calculates the n'th fibonacci number | |
| // main function | |
| int main (void) { | |
| int n = 1337; | |
| printf ("Fibonacci Number Calculator - Tolga Ay - 13011057\n\n\n\nEnter a negative number or zero to quit.\n\n"); | |
| while (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
| // This code walks through text files which including "marks", calculates average of them in threads | |
| #include <pthread.h> | |
| #include <dirent.h> | |
| #include <regex.h> | |
| #include <stdio.h> | |
| // Walks through all files, counts them and saves the directories to fileNames list | |
| int getFileNames(const char* dir, const char* pattern, const char** * fileNamesOut, short* fileCountOut); | |
| // Error Codes |
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> | |
| // FILE INPUT INFO | |
| #define N 2420 // Number of words | |
| #define WORD_LEN 5 // Character count of a word | |
| // INPUTS | |
| #define VALIDATE_GRAPH_CREATION 1 | |
| #define SRC_WORD "prove" // Word to start searching | |
| #define DEST_WORD "guess" // Word to find |
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> | |
| #include <memory.h> | |
| #include <string.h> | |
| #define PASSWORD_TO_CRACK "vK6b" | |
| // Increment the lowest digit by 1, check if it passed the last character in the char set | |
| int incrementPass(char* password, int maxChar, int currLength) { | |
| ++password[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
| inf="input_list.txt" # this file has lines like [201504695,ASLI,ASLAN,a.aslan@ce1.yildiz.edu.tr,CS101,89,2] | |
| outf="list.txt" | |
| sep=',' #define seperator | |
| #filter the list | |
| list=$(cat $inf ` | |
| `| egrep "2015.*(CS101|CS102),([6-9][0-9]|100).*" ` # filter with CS101 OR CS102, 2015 and 60 <= mark | |
| `| sed 's/-//1' ` # remove - from the number | |
| `| awk -F $sep 'int($7)==2' ` # second time they take the lesson | |
| `| awk -F $sep 'int($6)<90' ` # mark < 90 |
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> | |
| typedef struct Process { | |
| unsigned int id; | |
| int cpu_time; | |
| int last_start_time; | |
| int preemption_count; | |
| } Process; |
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> | |
| #include <string.h> | |
| #include <limits.h> | |
| #include <math.h> | |
| int main(){ | |
| char words[100][100]; | |
| int word_count = 0, line_length; |
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
| <!DOCTYPE Course_Catalog [ | |
| <!ELEMENT Course_Catalog (Department+)> | |
| <!ELEMENT Department (Title,Course*,Professor*,Lecturer*)> | |
| <!ELEMENT Professor (First_Name,Middle_Initial?,Last_Name)> | |
| <!ELEMENT Lecturer (First_Name,Middle_Initial?,Last_Name)> | |
| <!ELEMENT Course (Title,Description?)> | |
| <!ELEMENT Description (#PCDATA | Courseref)*> | |
| <!ELEMENT Courseref EMPTY> | |
| <!ELEMENT Title (#PCDATA)> | |
| <!ELEMENT First_Name (#PCDATA)> |
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 <conio.h> | |
| #define SIZE_X 6 | |
| #define SIZE_Y 6 | |
| // Visibility and Walls around | |
| typedef struct CELL { char mid, N, E, S, W; } CELL; | |
| CELL maze[SIZE_X][SIZE_X]; |
OlderNewer