C Program to Count Non Leaf Nodes in a Tree

This is a C Program to calculate number of non leaf nodes in a tree. Problem Description We are given a tree, and we have to write a C program to find the total number of non leaf nodes present in a tree using recursion. We have to create a recursive function which takes in … Read more

advertisement

C Program to Find Maximum Distance Between Two Nodes in a Binary Tree

This C Program finds nodes which are at maximum distance in binary tree. Here is source code of the C Program find nodes which are at maximum distance in binary tree. The C program is successfully compiled and run on a Linux system. The program output is also shown below. /*  * C Program to … Read more

advertisement

C Program to Print Height and Depth of Binary Tree

This C Program print height and depth of given binary tree. Here is source code of the C Program to print height and depth of given binary tree. The C program is successfully compiled and run on a Linux system. The program output is also shown below. /* * C Program to Print Height and Depth … Read more

advertisement

C Program to Print Border of given Tree in Anticlockwise Direction

This C Program print border of given tree in anticlockwise direction. Here is source code of the C Program to print border of given tree in anticlockwise direction. The C program is successfully compiled and run on a Linux system. The program output is also shown below. /* * C Program to Print Border of given … Read more

advertisement

C Program to Count Leaf Nodes in a Tree

This is a C Program to calculate number of leaf nodes in a tree. Problem Description We are given a tree, and we have to write a C program to find the total number of leaf nodes present in a tree using recursion. We have to create a recursive function which takes in root of … Read more

advertisement

C Program to Construct a Binary Search Tree and Perform Deletion and Inorder Traversal

This C Program constructs binary search tree and perform deletion, inorder traversal on it. Here is source code of the C Program to construct a binary search tree and perform deletion, inorder traversal on it. The C program is successfully compiled and run on a Linux system. The program output is also shown below. /* … Read more

advertisement

DFS Traversal of a Tree using Recursion in C

The following C program, using recursion, performs a Depth First Search traversal. Depth-first search (DFS) is an algorithm for traversing or searching a tree, tree structure or graph. The concept of backtracking is used in DFS. In this program we are performing DFS on a binary tree. In DFS, the deepest and univisited node is … Read more

advertisement

C Program to Traverse the Tree using Recursion

The following C program, using recursion, performs traversal operation across the nodes in a tree. The tree we have used is the binary search tree. The user generates a tree by inserting integers. The user is also asked to select one of the three modes of traversal, ie, infix, prefix and postfix. The user can … Read more

advertisement

DFS Traversal of a Tree Without using Recursion in C

The following C program, using iteration, performs a Depth First Search traversal. Depth-first search (DFS) is an algorithm for traversing or searching a tree, tree structure or graph. The concept of backtracking is used in DFS. In this program we are performing DFS on a binary tree. In DFS, the deepest and univisited node is … Read more

advertisement

C Program to Implement a B Tree

This C Program constructs a binary tree. Here is source code of the C Program to construct a binary tree. The C program is successfully compiled and run on a Linux system. The program output is also shown below. /* * C Program to Construct a B Tree */ /*************************** * binarytree.h ***************************/ typedef char DATA; struct node{ DATA d; struct node … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.