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::fmt::Debug; | |
use std::rc::Rc; | |
use std::cell::RefCell; | |
use std::any::{Any, TypeId}; | |
const M: usize = 5; | |
#[derive(Debug)] | |
pub struct BPlusTree<K, V> | |
where |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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::boxed::Box; | |
use std::cmp::max; | |
#[derive(Debug, Clone, PartialEq)] | |
pub struct Node { | |
height: isize, | |
key: isize, | |
left: Option<Box<Node>>, | |
right: Option<Box<Node>>, | |
} |
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::boxed::Box; | |
#[derive(Debug)] | |
pub struct Node | |
{ | |
data: isize, | |
left: Option<Box<Node>>, | |
right: Option<Box<Node>>, | |
} |
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
// 5 tokens, and whenever you purchase items there is a processing fee of 1 | |
// token. A player of the game will type in how many items they want to buy, | |
// and the `total_cost` function will calculate the total number of tokens. | |
// Since the player typed in the quantity, though, we get it as a string-- and | |
// they might have typed anything, not just numbers! | |
// Right now, this function isn't handling the error case at all (and isn't | |
// handling the success case properly either). What we want to do is: | |
// if we call the `parse` function on a string that is not a number, that | |
// function will return a `ParseIntError`, and in that case, we want to |
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
// move_semantics1.rs | |
// Make me compile! Scroll down for hints :) | |
pub fn main() { | |
let vec0 = Vec::new(); | |
let mut vec1 = fill_vec(vec0); | |
println!("{} has length {} content `{:?}`", "vec1", vec1.len(), vec1); |
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
fn main() { | |
use std::collections::HashMap; | |
//マクロの定義 | |
macro_rules! hash { | |
( $( $t:expr),* ) => { | |
{ | |
let mut temp_hash = HashMap::new(); | |
$( | |
temp_hash.insert($t.0, $t.1); |