pydatastructs icon indicating copy to clipboard operation
pydatastructs copied to clipboard

feat: add Parent Pointer Tree

Open FamALouiz opened this issue 9 months ago • 2 comments

References to Issue

Resolves #325

Brief description of what is implemented

  • Added parent pointer tree for python backend
  • Added parent pointer tree tests

FamALouiz avatar Mar 19 '25 18:03 FamALouiz

In my opnion, for add a new data structure or algorithm for public, the final interception is reserved by czgdp1807.

First step is append the class or function in the beginning array __all__ of the file. Like:

__all__ = [
    'MAryTree',
    'ParentPointerTree'
]

Secondly, add the API in the module's __init__.py file. Like

from .m_ary_trees import (
    MAryTreeNode, MAryTree,
    ParentPointerTreeNode, ParentPointerTree
)

For ParentPointerTreeNode, you can check the above steps.

Three, after above two steps, you can import ParentPointerTree by

from pydatastructs import MAryTree, ParentPointerTree

Lastly, update your new datastructure in docs.

TripleCamellya avatar Mar 20 '25 03:03 TripleCamellya

Yea, points 1, 2, and 4 are valid. I had forgotten to add them.

As for point 3, I was following the importing style in the other files. In the other files, they important it differently. For example,

from pydatastructs.linear_data_structures.arrays import ArrayForTrees

However, The points are nice regardless thanks :)

FamALouiz avatar Mar 20 '25 10:03 FamALouiz