lib/splay_tree.rb
#
# (!) lookup for the node to delete first (which means 2 traversal of the tree
# 1 for the lookup and 1 for the deletion - is this acceptable?
# yes if we are concern about separation of concern: 1 - search, 2 - manipulate the tree
#
# return the parent's node to delete (which is a node)
#
(!) lookup for the node to delete first (which means 2 traversal of the tree
1 for the lookup and 1 for the deletion - is this acceptable.
yes if we are concern about separation of concern: 1 - search, 2 - manipulate the tree

return the parent's node to delete (which is a node)
( ! ) lookup for the node to delete first ( which means 2 traversal of the tree 1 for the lookup and 1 for the deletion - is this acceptable . yes if we are concern about separation of concern : 1 - search 2 - manipulate the tree return the parent ' s node to delete ( which is a node )
def delete(val, root=@root)
      node, link, found = _search(val, root)
       delete(current node, current's parent, link <from parent to curr>)
      _delete_node(node, node.pnode, link)  if found
      _splay(root, node)  if splay
    end
def delete ( val , root = @root ) node , link , found = _search ( val , root ) _delete_node ( node , node . pnode , link ) if found _splay ( root , node ) end
(!)
( ! )
# # delete(current node, current's parent, link <from parent to curr>) # if splay
val
<not_specific>
root
<not_specific>