Data Structures and Algorithms Discussion Board
September 10, 2010, 02:46:01 PM *
Welcome, Guest. Please login or register.
Login with username, password and session length
News: Looking for a reliable webhosting provider? Read HostGator review to find 7 arguments in support of HostGator.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to display all the leaf nodes in a binary search tree?  (Read 1981 times)
Denis
Newbie
*

Rating: 0
Offline Offline

Posts: 21


« on: March 06, 2009, 11:53:54 AM »

This is a reply to the question of one of our readers: "How to display all the leaf nodes in a binary search tree? Algorithm, please."

The algorithm is quite simple. As a base for the solution take this article: Binary Search Tree. Get values in order. Now, instead of getting all the values, take leaves only (nodes, which have no children, left = right = NULL).
« Last Edit: November 21, 2009, 04:22:46 AM by Algolist.net Editor » Logged
Pages: [1]
  Print  
 
Jump to:  

 
Partners Ads        Play free games at 85play.com