Scheme RSR5

All problems are to be solved using R5RS within drracket,

no vectors, no strings, no assignment ...


; For this problem, we will think of 0 as a convenient substitute for a left bracket,

; and 1 as a convenient substitute for a right bracket.

; A sequence of 0s and 1s is said to be balanced if (i) every 0 is later

; closed by some 1, and (ii) every 1 closes a previous 0.

; Thus ((0 1)) is the list of all balanced sequences of length 2, and

; ( (0 0 1 1) (0 1 0 1) ) is a list of all balanced sequences of

; length 4

; Assuming n is a positive even integer, write and prove correct

; a function bal so that (bal n) returns a list - without duplicates -

; of all balanced sequences of 0s and 1s of length n. Your program

; should be as efficient as you can reasonably make it: at the very least, it should not generate

; any unbalanced sequences in the course of computing the final result.

; (hint: you will need a carefully considered recursive design and several

; auxiliary functions; I suggest that you use structural induction)

Kemahiran: Pengaturcaraan C++, Algoritma, Kejuruteraan, Scheme, Pengaturcaraan

Lihat lagi: make cell phone program, make diablo dupe program, make fan shaped program, make mu online program, make password checker program, make simple dictionary program perl, make simple inventory program java, make stock management program, make tcp socket program duplex, make tunneling windows program, make vb net program require key, make visual basic program hindi, make visual sandbox program, write efficient program using mpi adds 1024 numbers, make an icon program, make free advertisement program, make icon javascript program, make up online program, make video upload program, how to make a bot program

Tentang Majikan:
( 9 ulasan ) South Ozone Park, United States

ID Projek: #28200332