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
| #[inline] | |
| fn merge<T>(left: &mut [T], right: &mut [T]) -> Vec<T> | |
| where T: PartialOrd + Copy + Default | |
| { | |
| let mut array:Vec<T> = vec![T::default(); left.len() + right.len()]; | |
| let (mut left_idx, mut right_idx, mut idx) = (0, 0, 0); | |
| while left_idx < left.len() && right_idx < right.len() { | |
| if left[left_idx] != left[left_idx] { | |
| array[idx] = right[right_idx]; |
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
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| from typing import List | |
| def merge_sort(array: List[int]): | |
| if len(array) <= 1: | |
| return | |
| mid = len(array) // 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
| use std::collections::HashMap; | |
| use std::thread; | |
| use std::time::Duration; | |
| struct Casher<T, K, V> | |
| where | |
| T: Fn(K) -> V, | |
| { | |
| calculation: T, | |
| value: HashMap<K, V>, |
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
| use std::collections::HashMap; | |
| fn main() { | |
| let integer_list = [ | |
| 20, 47, 85, 99, 80, 86, 90, 89, 74, 9, 51, 78, 86, 36, 4, 68, 71, 42, 1, 64, | |
| ]; | |
| let mut result_vec: Vec<f64> = vec![0.0; 3]; | |
| result_vec[0] = integer_list.iter().sum::<i64>() as f64 / integer_list.iter().count() as f64; | |
| { |
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
| /** Exercise 3-3 from K&R The C programming language Book */ | |
| #include <stdio.h> | |
| #include <ctype.h> | |
| #define MAX_LENGTH 1000 | |
| void expand(char s1[], char s2[]); | |
| int 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
| <html> | |
| <head></head> | |
| <body> | |
| <h1>Hello World</h1> | |
| <ul id="test"> | |
| </ul> | |
| <input type='text' id="input_node"/> | |
| <button onClick="send_data()">Send data!</button> | |
| <script src="{{ static('index.js') }}"></script> | |
| </body> |
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
| #!/usr/bin/env python3 | |
| from random import randint | |
| counter = { | |
| 'wins': 0, | |
| 'games': 0 | |
| } | |
| print('Hello! I wanna play a little game') |