You are on page 1of 2

A binary tree is a tree data structure where each node has up to two child nodes, creating the

branches of the tree. The two children are usually called the left and right nodes. Parent nodes
are nodes with children, while child nodes may include references to their parents.

A binary tree is made up of at most two nodes, often called the left and right nodes, and
a data element. The topmost node of the tree is called the root node, and the left and
right pointers direct to smaller subtrees on either side.
Binary trees are used to implement binary search trees and binary heaps. They are also
often used for sorting data as in a heap sort.

Algorithm-
Steps for counting number of leaf nodes are:

 If node is null then return 0
 If encountered leaf node(i.e. node.left is null and node.right is null) then return 1.
 Recursively calculate number of leaf nodes using

Spanning tree
In the mathematical field of graph theory, a spanning tree T of an undirected graph G is a subgraph
that is a tree which includes all of the vertices of G, with minimum possible number of edges. In
general, a graph may have several spanning trees, but a graph that is not connected will not contain
a spanning tree (but see Spanning forests below). If all of the edges of G are also edges of a
spanning tree T of G, then G is a tree and is identical to T (that is, a tree has a unique spanning tree
and it is itself).
A tree is a connected undirected graph with no cycles. It is a spanning tree of a graph G if it
spans G (that is, it includes every vertex of G) and is a subgraph of G (every edge in the tree
belongs to G). A spanning tree of a connected graph G can also be defined as a maximal set of
edges of G that contains no cycle, or as a minimal set of edges that connect all vertices.

Planar graph
In graph theory, a planar graph is a graph that can be embedded in the plane, i.e., it can be drawn
on the plane in such a way that its edges intersect only at their endpoints. In other words, it can be
drawn in such a way that no edges cross each other.[1] Such a drawing is called a plane
graph or planar embedding of the graph. A plane graph can be defined as a planar graph with a
mapping from every node to a point on a plane, and from every edge to a plane curve on that plane,
such that the extreme points of each curve are the points mapped from its end nodes, and all curves
are disjoint except on their extreme points.
Every graph that can be drawn on a plane can be drawn on the sphere as well, and vice versa, by
means of stereographic projection.
Plane graphs can be encoded by combinatorial maps.
The equivalence class of topologically equivalent drawings on the sphere is called a planar map.
Although a plane graph has an externalor unbounded face, none of the faces of a planar map have
a particular status.
Planar graphs generalize to graphs drawable on a surface of a given genus. In this terminology,
planar graphs have graph genus 0, since the plane (and the sphere) are surfaces of genus 0. See
"graph embedding" for other related topics.

Euler's formula
Euler's formula, named after Leonhard Euler, is a mathematical formula in complex analysis that
establishes the fundamental relationship between the trigonometric functions and
the complex exponential function. Euler's formula states that for any real number x:

where e is the base of the natural logarithm, i is the imaginary unit, and cos and sin are
the trigonometric functions cosine and sinerespectively, with the argument x given in radians.
This complex exponential function is sometimes denoted cis x ("cosine plus i sine"). The
formula is still valid if x is a complex number, and so some authors refer to the more general
complex version as Euler's formula.[1]
Euler's formula is ubiquitous in mathematics, physics, and engineering. The physicist Richard
Feynman called the equation "our jewel" and "the most remarkable formula in mathematics".[2]

When , Euler's formula evaluates to , which is known as Euler's identity.

You might also like