We have discussed Introduction to Binary Tree in set 1. In this post, properties of binary are discussed. 1) The maximum number of nodes at level ‘l’ of a b
A Binary Tree is labeled if every node is assigned a label and a Binary Tree is unlabeled if nodes are not assigned any label. Below two are considered same unl
We have discussed Introduction to Binary Tree in set 1 and Properties of Binary Tree in Set 2. In this post, common types of binary is discussed. Following are
Given the array representation of Complete Binary Tree i.e, if index i is the parent, index 2*i + 1 is the left child and index 2*i + 2 is the right child. The
We are given a sorted array A[] of n elements. We need to find if x is present in A or not.In binary search we always used middle element, here we will randomly
Write a program to print Binary representation of a given number. Recommended: Please solve it on “PRACTICE” first, before moving on to the solution. Source
Given an integer ‘x’, write a C function that returns true if binary representation of x is palindrome else return false. For example a numbers with binary
Give an integer n. We can flip exactly one bit. Write code to find the length of the longest sequence of 1 s you could create. Examples: Input : 1775 Output : 8
Binary search is a popular method of searching in a sorted array or list. It simply divides the list into two halves and discard the half which has zero probabi
Prerequisites : Union Find (or Disjoint Set), Disjoint Set Data Structures (Java Implementation) A disjoint-set data structure maintains a collection S = {S1, S
A Binary Heap is a Complete Binary Tree. A binary heap is typically represented as array. The representation is done as: The root element will be at Arr[0]. Bel
Given two binary max heaps as arrays, merge the given heaps. Examples : Input : a = {10, 5, 6, 2}, b = {12, 7, 9} Output : {12, 10, 9, 2, 5, 7, 6} Recommended:
A Binary Heap is a Binary Tree with following properties. 1) It’s a complete tree (All levels are completely filled except possibly the last level and the las
An n-ary tree in computer science is a collection of nodes normally represented hierarchically in the following fashion. The tree starts at the root node. Each
Given a Binary Tree, convert it to a Binary Search Tree. The conversion must be done in such a way that keeps the original structure of Binary Tree. This soluti
Inorder traversal of a Binary tree can either be done using recursion or with the use of a auxiliary stack. The idea of threaded binary trees is to make inorder
We have discussed Threaded Binary Tree. The idea of threaded binary trees is to make inorder traversal faster and do it without stack and without recursion. In
Prerequisite: Getting started with Classification In this article, we will discuss a method to calculate efficiency of Binary classifier. Let’s assume there i
It’s unique and quite intriguing to discover that quantum mechanics can manifest itself in a form that could enhance the capabilities of traditional computer
Binary is a base-2 number system that uses two states 0 and 1 to represent a number. We can also call it to be a true state and a false state. A binary number i
A Boolean function is described by an algebraic expression consisting of binary variables, the constants 0 and 1, and the logic operation symbols For a given se
In Digital Electronics, discrete quantities of information are represented by binary codes. A binary code of n bits is capable of representing up to 2^n distin