Stuzul
New Member
- Joined
- Mar 10, 2012
- Messages
- 23
- Gender
- Male
- HSC
- 2014
Hey guys, im swondering if anyone could explain this o me. dont have a textbook on me so i cant look it up
ok, i get whats going on in cbn, its pretty obvious, buy whats the go with lfind and rfind? and are there any more that i need to know?
Any help would be greatly appreciate
cheers
A functional language supports the following data structures:
[ Nick , Ally ]
[ 1 , 2 , 37 ]
[ 7 , 9 , XY , talk ]
The language includes three built-in functions:
CBN, LFIND and RFIND
Examples of manipulations using these functions are shown below:
CBN ( [ 6 , 8 ] , [ 7 , BJ , PING ] ) = [ 6 , 8 , 7 , BJ , PING ]
LFIND ( 3 , [ 4 , 5 , 11 , 27 , 67 , 17 ] ) = 11
RFIND ( 2 , [ 4 , 5 , 11 , 27 , FISH , 17 ] ) = FISH
(i) Evaluate, showing all working:
RFIND ( 4 , CBN ( [ 3 , 9 , 2 , AARON ] , [ AS ] ))
(ii) Evaluate, showing all working:
RFIND ( LFIND ( 3 , [ 45 , 6 , 2 , TOM ] ) , [ PINK , BLUE , RED , GREEN ] )
ok, i get whats going on in cbn, its pretty obvious, buy whats the go with lfind and rfind? and are there any more that i need to know?
Any help would be greatly appreciate
cheers
A functional language supports the following data structures:
[ Nick , Ally ]
[ 1 , 2 , 37 ]
[ 7 , 9 , XY , talk ]
The language includes three built-in functions:
CBN, LFIND and RFIND
Examples of manipulations using these functions are shown below:
CBN ( [ 6 , 8 ] , [ 7 , BJ , PING ] ) = [ 6 , 8 , 7 , BJ , PING ]
LFIND ( 3 , [ 4 , 5 , 11 , 27 , 67 , 17 ] ) = 11
RFIND ( 2 , [ 4 , 5 , 11 , 27 , FISH , 17 ] ) = FISH
(i) Evaluate, showing all working:
RFIND ( 4 , CBN ( [ 3 , 9 , 2 , AARON ] , [ AS ] ))
(ii) Evaluate, showing all working:
RFIND ( LFIND ( 3 , [ 45 , 6 , 2 , TOM ] ) , [ PINK , BLUE , RED , GREEN ] )
Last edited: