- Related Questions & Answers
- k-ary tree in Data Structure
- Encode N-ary Tree to Binary Tree in C++
- Mirror of n-ary Tree in C++
- N-ary Tree Preorder Traversal in C++
- N-ary Tree Level Order Traversal in C++
- Serialize and Deserialize N-ary Tree in C++
- Preorder Traversal of N-ary Tree Without Recursion in C++
- Print all leaf nodes of an n-ary tree using DFS in C++
- N-ary Relationship in Database
- M-Coloring Problem
- Find a positive number M such that gcd(N^M,N&M) is maximum in Python
- Sum of even numbers from n to m regardless if n<m or n>m JavaScript
- Month ("M", "m") Format Specifier in C#
- Huffman Algorithm for t-ary Trees in Data Structure
- Calculate market equity using below data according to the M-M Approach.

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

An m-ary tree in computer science is defined as a collection of nodes normally represented hierarchically in the following manner.

- The tree is started at the root node.
- Each node of the tree maintains a list of pointers to its child nodes.
- The number of child nodes is less than or equal to m.

A typical representation of m-ary tree implements an array of m references (or pointers) to store children (Note that m is an upper bound on number of children).

An m-way search tree

a. is empty or

b. consists of a root containing b (1<=b<m) keys, kb, and a set of sub-trees, Ta, (a = 0..b), such that

- if k is a key in T0, then k <= k1
- if k is a key in Ta (0<a<b), then ka <= k <= ka+1
- if k is a key in Tb, then k > kb and
- all Ta are nonempty m-way search trees or all Ta are empty

Image of m-ary Tree

The height of a complete m-ary tree associated with n nodes is ceiling(log_{m}n).

A B-tree of order m is an m-way tree in which

a. all leaves should be on the same level and

b. all nodes except for the root and the leaves have minimum m/2 children and maximum m children. The root has minimum 2 children and maximum m children.

Advertisements