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
| // Implements a dictionary's functionality | |
| #include <stdbool.h> | |
| #include <ctype.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include "dictionary.h" | |
| #include <string.h> | |
| #include <strings.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
| // Simulate genetic inheritance of blood type | |
| #include <stdbool.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <time.h> | |
| // Each person has two parents and two alleles | |
| typedef struct person | |
| { |
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 <stdint.h> | |
| typedef uint8_t BYTE; | |
| int main(int argc, char *argv[]) | |
| { | |
| if (argc != 2) | |
| { |
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 "helpers.h" | |
| #include <math.h> | |
| // Convert image to grayscale | |
| void grayscale(int height, int width, RGBTRIPLE image[height][width]) | |
| { | |
| for (int i = 0; i < height; i++) | |
| { | |
| for (int j = 0; j < width; j++) | |
| { |
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 "helpers.h" | |
| #include <math.h> | |
| // Convert image to grayscale | |
| void grayscale(int height, int width, RGBTRIPLE image[height][width]) | |
| { | |
| for (int i = 0; i < height; i++) | |
| { | |
| for (int j = 0; j < width; j++) | |
| { |
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
| // Modifies the volume of an audio file | |
| #include <cs50.h> | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <math.h> | |
| // Number of bytes in .wav header | |
| const int HEADER_SIZE = 44; |
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 <cs50.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <ctype.h> | |
| #include <math.h> | |
| #include <stdlib.h> | |
| // Max voters and candidates | |
| #define MAX_VOTERS 100 | |
| #define MAX_CANDIDATES 9 |
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 <cs50.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <ctype.h> | |
| #include <math.h> | |
| #include <stdlib.h> | |
| // Max number of candidates | |
| #define MAX 9 |
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
| sort1 uses: Bubble Sort | |
| How do you know?: I checked the time for the least amount of data in the sorted state based on omega. | |
| sort2 uses: Merge Sort | |
| How do you know?: I checked the time for the least amount of data in the sorted state based on omega. | |
| sort3 uses: Selection 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 <cs50.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <ctype.h> | |
| #include <math.h> | |
| #include <stdlib.h> | |
| //Variable. | |
| int s = 0; | |
| int main(int argc, string argv[]) | |
| { |