More feedback :)

Do not return nil 
Check the last lecture of the mooc

Did you read Pharo with Style?

I do not know if LinkedList is the one of the system used by Process but in 
that case use the alternate implementation. 


bfs: info
        "Breadth fisrt search for an information. If there is no key containing 
given infomration returns nil. If the info is found returns a node containing 
it"
        | queue |
        self isEmpty 
        ifTrue: [ ^nil ].
        queue := LinkedList new.
        queue addLast: self root.
        
        [ queue isNotEmpty ] whileTrue: [ 
                | node |
                node := queue removeFirst.
                node key == info  
                ifTrue: [ ^node ].
                node leftChild isNotNil 
                ifTrue: [ queue addLast: node leftChild ].
                node rightChild isNotNil
                ifTrue: [ queue addLast: node rightChild ].
                 ].
                ^nil.

=> 

bfs: info
        "Breadth fisrt search for an information. If there is no key containing 
given infomration returns nil. If the info is found returns a node containing 
it"
        | queue |
        self isEmpty ifTrue: [ ^ self ].
        queue := LinkedList new.
        queue addLast: self root.
        
        [ queue isNotEmpty ] whileTrue: [ 
                | node |
                node := queue removeFirst.
                node key == info  
                        ifTrue: [ ^node ].
                node leftChild isNotNil 
                        ifTrue: [ queue addLast: node leftChild ].
                node rightChild isNotNil
                        ifTrue: [ queue addLast: node rightChild ].
                 ]

Reply via email to