[Scheme] 循環のあるグラフをコピーする

コンスセルを使った循環のあるグラフをコピーする関数は次のように書ける。 (define (copy-graph-sub ht graph) (cond ((not (pair? graph)) graph) ((hash-table-exists? ht graph) (hash-table-ref ht graph)) (else (let ((p (cons #f #f))) (hash-table-set! ht graph p) (set-car! p (copy-graph-sub ht (car graph))) (set-cdr! p (copy-graph-sub ht (cdr graph))) p)))) (define Continue reading [Scheme] 循環のあるグラフをコピーする


Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
Posted in コンピュータ | Tagged , , | Leave a reply