Skip to content

smarizvi110/Complete-Binary-Tree-Construction-Using-Post-Order-Traversal-in-Haskell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Complete Binary Tree Construction Using Post-Order Traversal in Haskell

As defined on Wikipedia, "a complete binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes in the last level are as far left as possible. It can have between 1 and 2h nodes at the last level h."

This file contains code in Haskell that constructs the tree, given a list of elements of a complete binary tree in post-order traversal. The definition of the tree data structure is in the code snippet is below.

data Tree a = Nil | TreeNode (Tree a) a (Tree a) deriving (Show)

About

Constructing a complete binary tree in Haskell using its post-order traversal.

Topics

Resources

License

Stars

Watchers

Forks