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
$ echo $PATH | tr : '\n' | sort | |
/bin | |
/home/ugrad/11/s1111411/perl5/perlbrew/bin | |
/home/ugrad/11/s1111411/perl5/perlbrew/perls/perl-5.14.1/bin | |
/opt/local/bin | |
/sbin | |
/usr/X11/bin | |
/usr/bin | |
/usr/local/bin | |
/usr/local3/bin |
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
let diff l1 l2 = | |
List.filter (fun e -> List.fold_left (fun x y -> y != e && x) true l2) l1;; |
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
type 'a tree = Lf | Br of 'a * 'a tree * 'a tree;; | |
let rec height t = | |
match t with | |
Lf -> 1 | |
| Br (_, t1, t2) -> | |
if (height t1) > (height t2) then | |
1 + (height t1) | |
else | |
1 + (height t2);; |
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
inorder (reflect t) = rev (inorder t) について | |
(i) t = Lf の時、成り立つことを示せばよい。 | |
<左辺> = inorder (reflect Lf) | |
= inorder Lf reflectの定義より | |
= [] inorderの定義より | |
<右辺> = rev (inorder Lf) | |
= rev Lf inorderの定義より |
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> | |
void plus_minus (int *a, int *b) { | |
int a_ori = *a, | |
b_ori = *b; | |
*a = a_ori + b_ori; | |
*b = a_ori - b_ori; | |
} |
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> | |
void swap_array (int a[], int i, int j) { | |
int t = a[i]; | |
a[i] = a[j]; | |
a[j] = t; | |
} | |
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
#include <stdio.h> | |
float sum_array (float array[], int n) { | |
float a = 0.0; | |
int i; | |
for (i=0; i<n; i++) | |
a += array[i]; | |
return a; |
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
\documentclass{jarticle} | |
\makeatletter | |
\def\tuple#1{% | |
\begingroup | |
\newcount\@fuck@i | |
\newcount\@fuck@ii | |
\@fuck@i = -1 | |
\@fuck@ii = 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
#include <stdio.h> | |
void plus_minus(int *a, int *b) | |
{ | |
int t1 = *a, | |
t2 = *b; | |
*a = t1 + t2; | |
*b = t1 - t2; | |
} |
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> | |
void swap_array(int a[], int x, int y) | |
{ | |
int t = a[x]; | |
a[x] = a[y]; | |
a[y] = t; | |
} |