コード例 #1
0
        public static Leaf GetPreviousLeaf(this IBinaryNode current)
        {
            var prev = current.GetPrevious();

            while (prev != null)
            {
                if (prev is Leaf leaf)
                {
                    return(leaf);
                }

                prev = prev.GetPrevious();
            }

            return(null);
        }