Skip to content
Snippets Groups Projects

find c-engines.

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Steve Traylen
    Edited
    example.py 247 B
    # Build a test tree
    root = Node(1)
    root.left = Node(2)
    root.right = Node(3)
    root.left.left = Node(4)
    root.left.right = Node(5)
    root.right.left = Node(6)
    root.right.right = Node(7)
    
    print(find_cousins(root, 4))  # Output should be [6, 7]
    find-c-engines.py 4.08 KiB
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment