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
| public class FindPairs { | |
| public static int countPairs(int[] a) { | |
| Integer[] pairsFound = new Integer[a.length]; | |
| // Get the ith item in the list | |
| for (int i = 0; i < a.length; i++) { |
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
| public void function(int N) { | |
| Stack<Integer> stack = new Stack<Integer>(); | |
| while (N > 0) { | |
| stack.push(N % 2); | |
| N = N / 2; | |
| } | |
| for (int b: stack) {StdOut.print(b);} |
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
| /****************************************************************************** | |
| * Compilation: javac LinkedStackOfStrings.java | |
| * Execution: java LinkedStackOfStrings | |
| * Data files: https://introcs.cs.princeton.edu/java/43stack/tobe.txt | |
| * | |
| * A stack of strings, implemented using a linked list. | |
| * | |
| * % more tobe.txt | |
| * to be or not to - be - - that - - - is | |
| * |
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
| /****************************************************************************** | |
| * Compilation: javac FixedCapacityStackOfStrings.java | |
| * Execution: java FixedCapacityStackOfStrings | |
| * Dependencies: StdIn.java StdOut.java | |
| * | |
| * Stack of strings implementation with a fixed-size array. | |
| * | |
| * % more tobe.txt | |
| * to be or not to - be - - that - - - is | |
| * |
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
| import edu.princeton.cs.algs4.In; | |
| import edu.princeton.cs.algs4.Quick; | |
| public class Filtering34 { | |
| public static void minMaxFilter() { | |
| In in = new In(); | |
| int max = in.readInt(); | |
| int min = max; |
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 main(int argc, char *argv[]) { | |
| int fahr, celsius; | |
| /*Accessing a c.l. arg: argv[n];*/ | |
| fahr = lower; |
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
| int main() { | |
| int i, j, rows; | |
| scanf("%d", &rows); | |
| printf("\n"); | |
| } | |
| } |
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
| int main() { | |
| scanf("%d", &rows); | |
| #include <stdio.h> | |
| return 0; | |
| for (j = 1; j <= i; ++j) { | |
| } | |
| } | |
| for (i = rows; i >= 1; --i) { | |
| } | |
| int i, j, rows; |
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
| #! /Users/bgideon/PycharmProjects/KeywordComparison/venv/bin/python | |
| ### !!!! Your interpreter path will be different! Find it with `which python3` | |
| import sys | |
| def get_kws(): | |
| py_kws = [] | |
| c_kws = [] |
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
| import com.fasterxml.jackson.databind.ObjectMapper; | |
| import java.io.IOException; | |
| import java.net.URISyntaxException; | |
| import java.net.http.HttpClient; | |
| import java.net.http.HttpRequest; | |
| import java.net.http.HttpResponse; | |
| import java.net.URI; | |
| import java.util.HashMap; |