Hafeezul Kareem has Published 328 Articles

Depth of the deepest odd level node in Binary Tree in C++ Program

Hafeezul Kareem

Hafeezul Kareem

Updated on 27-Jan-2021 12:24:53

135 Views

In this tutorial, we are going to learn how to find the deepest odd level node in a binary tree.This is similar to finding the depth of the binary tree. Here, we have to one more condition i.e.., whether the current level is odd or not.Let's see the steps to ... Read More

Depth of an N-Ary tree in C++ Program

Hafeezul Kareem

Hafeezul Kareem

Updated on 27-Jan-2021 12:22:15

1K+ Views

In this tutorial, we are going to learn how to find the depth of the n-ary tree.An n-ary tree is a tree in which each node of the tree has no more than n child nodes.We have to find the depth of the n-ary tree. We will be using the ... Read More

Density of Binary Tree in One Traversal in C++ Program

Hafeezul Kareem

Hafeezul Kareem

Updated on 27-Jan-2021 12:20:55

266 Views

In this tutorial, we are going to learn how to find the density of the binary tree in a single traversal.The density of the binary tree is obtained by dividing the size of the tree by the height of the tree.The size of the binary tree is the total number ... Read More

Demlo number, Square of 11...1 in C++ Program

Hafeezul Kareem

Hafeezul Kareem

Updated on 27-Jan-2021 12:19:32

218 Views

In this tutorial, we are going to learn about the demlo number.The demlo numbers are the squares of the number 1, 11, 111, 1111, etc.., We can easily find the demlo number as it is in the form 1 2 3 4 5 ... n-2 n-1 n n-1 n-2 ... ... Read More

Deletions of “01” or “10” in binary string to make it free from “01” or “10” in C++ Program

Hafeezul Kareem

Hafeezul Kareem

Updated on 27-Jan-2021 12:15:32

238 Views

In this tutorial, we are going to write a program that finds the total number of pairs (01 or 10) to free the binary string from the pairs (01 and 10). Let's see an example.Input − 101010001Output − 4In the above example, we have to delete a total of 4 ... Read More

Deletion in a Binary Tree in C++ Program

Hafeezul Kareem

Hafeezul Kareem

Updated on 27-Jan-2021 12:14:23

6K+ Views

In this tutorial, we are going to learn how to delete a node in a binary tree.The nodes in a binary tree don't follow any order like binary search trees. So, how to arrange the nodes after deleting a node in a binary tree?Well, we will replace the deepest node ... Read More

Deleting a binary tree using the delete keyword in C++ program

Hafeezul Kareem

Hafeezul Kareem

Updated on 27-Jan-2021 12:11:35

2K+ Views

In this tutorial, we are going to learn how to delete a binary tree using the delete keyword.We are going to use a destructor member function to delete the binary. The destructor member function is invoked automatically when the object goes out of the scope or it is destroyed by ... Read More

Delete N nodes after M nodes of a linked list in C++ program

Hafeezul Kareem

Hafeezul Kareem

Updated on 27-Jan-2021 12:08:51

850 Views

In this tutorial, we are going to learn how to delete N nodes after M nodes in a linked list.Let's see the steps to solve the problem.Write a struct Node for the linked list node.Initialize the linked list with the dummy data.Write a function to delete N nodes after M ... Read More

Delete middle of linked list in C++ program

Hafeezul Kareem

Hafeezul Kareem

Updated on 27-Jan-2021 12:06:58

3K+ Views

In this tutorial, we are going to learn how to delete the middle node in a linked list.The solution to the problem is straightforward. We will have two pointers one moves one node at a time and the other one moves two nodes at a time. By the time the ... Read More

Delete leaf nodes with value k in C++ program

Hafeezul Kareem

Hafeezul Kareem

Updated on 27-Jan-2021 12:05:33

110 Views

In this tutorial, we are going to learn how to delete the leaf nodes from a tree with the given value.Let's see the steps to solve the problem.Write a struct Node for a binary tree.Write a function to traverse (inorder, preorder, postorder) through the tree and print all data.Initialize the ... Read More

Advertisements