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 <time.h> | |
| #include <stdint.h> | |
| #include <stdbool.h> | |
| #define MAX(A, B) (((A) > (B))? (A) : (B)) | |
| #define MIN(A, B) (((A) < (B))? (A) : (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
| using System.Collections.Generic; | |
| using System; | |
| public sealed class BinaryHeap<T> | |
| { | |
| private readonly List<T> _elements; | |
| private readonly Comparison<T> _compare; | |
| /// <summary> |
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 <iostream> | |
| #include <algorithm> | |
| #include <stdexcept> | |
| #include <functional> | |
| #include <unordered_map> | |
| #include <vector> | |
| template<typename K, typename P, typename Func = std::less<P>> | |
| class fib_heap { |
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 random | |
| import time | |
| def merge_sort(numbers, start, end): | |
| if start == end: | |
| return | |
| pivot_index = start + (end-start)//2 | |
| merge_sort(numbers, start, pivot_index) | |
| merge_sort(numbers, pivot_index+1, 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
| import java.util.Arrays; | |
| import java.util.HashSet; | |
| import java.util.Iterator; | |
| import java.util.Random; | |
| import java.util.Set; | |
| public class Main { |
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 java.util.ArrayDeque; | |
| import java.util.ArrayList; | |
| import java.util.Deque; | |
| import java.util.HashSet; | |
| import java.util.List; | |
| import java.util.Scanner; | |
| import java.util.Set; | |
| public class Main { |
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 DigitSum { | |
| public static int digit(int n) { | |
| String numbers = n + ""; | |
| int sum = 0; | |
| for (int x = 0; x < numbers.length(); x++) { | |
| sum += Integer.parseInt(numbers.charAt(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
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.Scanner; | |
| public class Main { | |
| public static void main(String[] args) { | |
| System.out.println("Starting program..."); | |
| int n = readFromKeyboard(); |
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
| using System; | |
| class MainClass | |
| { | |
| private static int[] copyArray(int[] A, int start, int end) | |
| { | |
| int[] result = new int[end - start]; | |
| int cnt = 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
| def compute_loan_cut(principal, month_interest_rate, total_months): | |
| divisor = (1 - pow(1 + month_interest_rate, total_months)) / (-month_interest_rate) | |
| return pow(1 + month_interest_rate, total_months) * principal / divisor | |
| print('Lowest Payment: ',end='') | |
| print(round(minPayment,2)) | |
| print("Loan cut:", compute_loan_cut(balance, mRate, 24)) |