0% found this document useful (0 votes)
8 views2 pages

Assignment 3 (YKPT 22181) (CS 301) (Section A)

Uploaded by

Lai Yee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Assignment 3 (YKPT 22181) (CS 301) (Section A)

Uploaded by

Lai Yee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Lai Lai Yee

YKPT-22181

Sem-IV(A)

Assignment-3
Write the difference of the following tree structures:

Quad Tree, Binary Tree and Binary Search Tree

Key Differences

Quad Tree: Each node has four children.

Binary Tree: Each node has at most two children.

Binary Search Tree: Each node has at most two children with a specific ordering property.

Quad Tree

A Quad Tree is a tree data structure in which each internal node has exactly four
children. It is commonly used to partition a two-dimensional space by recursively
subdividing it into four quadrants or regions. Each node in a Quad Tree represents a
quadrant of the space it is partitioning. The tree is typically balanced to some extent, as
each subdivision results in four new nodes, but it can become imbalanced depending on the
distribution of the data. Leaf nodes contain data or pointers to data representing the
smallest subdivisions.

Binary Tree

A Binary Tree is a tree data structure in which each node has at most two children, referred
to as the left child and the right child. The shape of a Binary Tree can vary widely; it can be
balanced or imbalanced. There is no inherent order in the nodes of a general Binary Tree, so
traversal methods (preorder, inorder, postorder) are used to process nodes.

Binary Search Tree (BST)

A Binary Search Tree is a type of Binary Tree. The defining characteristic of a binary search
tree is this: A node’s left child must have a key less than its parent, and a node’s right child
must have a key greater than or equal to its parents. BSTs maintain a specific order, which
allows for efficient searching, insertion, and deletion operations. Traversal methods
(especially inorder traversal) can be used to retrieve data in a sorted order.

You might also like