I see two parts of your question.
Part one: how to implement trees in a circuit.
In the standard R5RS, most tree implementations use vectors to represent nodes in the tree. For a binary tree with one, you can define some helper functions:
(define (tree-left t) (vector-ref t 0)) (define (tree-right t) (vector-ref t 1)) (define (tree-value t) (vector-ref t 2)) (define (make-node lrv) (vector lrv)) (define (leaf? t) (eq? t
In schemas with structures / records, this is replaced by>
(define-struct tree (left right value)) (define (leaf? t) (eq? t #f))
If hierarchies of structures are supported, you can write
(define-struct tree ()) (define-struct (leaf tree) ()) (define-struct (node tree) (left right value))
For schemes that support pattern matching code that controls trees, they look like tree-like processing code in ML and Haskell.
I can recommend the section on binary search trees in HtDP: http://htdp.org/2003-09-26/Book/curriculum-ZH-19.html#node_sec_14.2
Part Two: How to handle directory crawls
There are several approaches. One common way is to provide a function that defines a directory of a function or sequence that can an element (file or subdirectory) at a time. This avoids the need to store a potentially huge file tree in memory.
You can use sequences in Racket:
#lang racket (for ([file (in-directory "/users/me")]) (displayln file))
There are no directory traversal mechanisms in R5RS, but all major implementations, of course, offer one way or another by doing this.
BTW: It is true that Scheme provides very good support for single linked lists, but when implementing functional data structures, it is often better to use vectors or even better structures due to faster access to random elements.