Skip to content

Instantly share code, notes, and snippets.

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
@totechite
totechite / export.geojson
Last active April 30, 2019 14:41
overpassAPI OpenStreetMap じんじゃ geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@totechite
totechite / avl_tree.rs
Last active April 12, 2019 07:00
Rust-AVL木
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>>,
}
@totechite
totechite / binary_search_tree.rs
Last active March 8, 2019 12:03
Rust-二分探索木
use std::boxed::Box;
#[derive(Debug)]
pub struct Node
{
data: isize,
left: Option<Box<Node>>,
right: Option<Box<Node>>,
}
@totechite
totechite / Relasiving GoogleCalendar to THE iDOLM@STER Producer Schedule.md
Last active January 24, 2019 07:34
アイドルマスター プロデューサー予定表のGoogleCalendarリンク
@totechite
totechite / error1.rs
Created October 6, 2018 18:11
Practice Error Handling on rustlings.
// 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
@totechite
totechite / move_semantics1.rs
Last active May 17, 2023 02:33
My Rustlings answers
// 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);
@totechite
totechite / hash!_sample.rs
Last active November 15, 2019 06:12
[Rust]
fn main() {
use std::collections::HashMap;
//マクロの定義
macro_rules! hash {
( $( $t:expr),* ) => {
{
let mut temp_hash = HashMap::new();
$(
temp_hash.insert($t.0, $t.1);

bubbleS.py補足

def bubbleSort(files):
    frag = False  
    for idx in range(0, len(files) - 1):
        fst = int(re.search('\d+', files[idx]).group())  # 比較する左の数
        scd = int(re.search('\d+', files[idx + 1]).group())  # 比較する右の数
        if fst > scd:  # これは昇順の場合
 frag = True # フラグを立たせる