Skip to content

Latest commit

 

History

84 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binary Trees

This project explores the concept of binary trees and related data structures and algorithms.

Learning Objectives

At the end of this project, you will be able to:

  • Explain what a binary tree is and its basic properties.
  • Differentiate between a binary tree and a Binary Search Tree (BST).
  • Understand the potential advantages of using binary trees in terms of time complexity compared to linked lists.
  • Define the depth, height, and size of a binary tree and understand their significance.
  • Describe different traversal methods used to navigate through a binary tree.
  • Define and understand the characteristics of complete, full, perfect, and balanced binary trees.

Requirements

General

  • Allowed editors: vi, vim, emacs
  • Files compiled on Ubuntu 20.04 LTS using gcc with options -Wall -Werror -Wextra -pedantic -std=gnu89
  • All files should end with a new line
  • A README.md file at the root of the project folder is mandatory
  • Code should follow the Betty style guide
  • Avoid using global variables
  • Limit functions per file to no more than 5
  • Allowed to use the standard library
  • Prototypes of all functions should be included in the header file binary_trees.h
  • Header files should be include guarded

Files Included

  • binary_trees.h: Header file containing function prototypes and necessary declarations.
  • 0-binary_tree_node.c: Function to create a new binary tree node.
  • 1-binary_tree_insert_left.c: Function to insert a node as the left-child of another node in a binary tree.
  • 2-binary_tree_insert_right.c: Function to insert a node as the right-child of another node in a binary tree.
  • 3-binary_tree_delete.c: Function to delete an entire binary tree.
  • 4-binary_tree_is_leaf.c: Function to check if a node is a leaf in a binary tree.
  • 5-binary_tree_is_root.c: Function to check if a node is a root in a binary tree.
  • 6-binary_tree_preorder.c: Function to traverse a binary tree using pre-order traversal.
  • 7-binary_tree_inorder.c: Function to traverse a binary tree using in-order traversal.
  • 8-binary_tree_postorder.c: Function to traverse a binary tree using post-order traversal.
  • 9-binary_tree_height.c: Function to calculate the height of a binary tree.
  • 10-binary_tree_depth.c: Function to calculate the depth of a node in a binary tree.
  • 11-binary_tree_size.c: Function to calculate the size of a binary tree.
  • 12-binary_tree_leaves.c: Function to count the leaves in a binary tree.
  • 13-binary_tree_nodes.c: Function to count the nodes with at least one child in a binary tree.
  • 14-binary_tree_balance.c: Function to check the balance factor of a binary tree.
  • 15-binary_tree_is_full.c: Function to check if a binary tree is full.
  • 16-binary_tree_is_perfect.c: Function to check if a binary tree is perfect.
  • 17-binary_tree_sibling.c: Function to find the sibling of a node in a binary tree.
  • 18-binary_tree_uncle.c: Function to find the uncle of a node in a binary tree.
  • 100-binary_trees_ancestor.c: Function to find the lowest common ancestor of two nodes in a binary tree.
  • 101-binary_tree_levelorder.c: Function to traverse a binary tree using level-order traversal.
  • 102-binary_tree_is_complete.c: Function to check if a binary tree is complete.
  • binary_tree_print.c: Utility function to print a binary tree.

Authors

  • Fokoda799
  • fatimaelasri01

:)

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages