Programmer Friendly Data Structures (PFDS)

Nodes + data structures + methods = solutions.
16 Downloads
Updated 9 Jul 2024

View License

PFDS - Programmer Friendly Data Structures for MATLAB
July 9, 2024
PFDS provides data structures and nodes for problem solving.
PFDS is programmer friendly, made to integrate with MATLAB.
PFDS is made MATLAB friendly, not to replace MATLAB..
Solve your software problems by directly using or extending PFDS.
PFDS is implemented as a hierarchy of is-a class relationships.
There is a documented use relationship between nodes and data structures.
Nodes, data structures, and algorithms work together.
OO methods are algorithms for nodes and data structures.
Nodes match things in your problem space. Extend node types where needed.
Data structures provide organized nodes to which methods are applied.
Nodes and data structures work together to provide code insight.
Data structure info() function walks nodes and uses node info() function: >> object_reference.info()
Both data structures and nodes are open for extention by YOU. Class hierarchy is arranged for method reuse or modification.
Solutions.
Think nodes, extend selected node type to suit your problem.
Pick data structure for your problem. Use methods as a guide.
Add methods as needed to nodes and data structures.
Make nodes and add them to data structure.
Apply methods to data structure to obtain solution.
Is-a and has-a for applications both work fine. See examples listed below.
Use PFDS test code and example code to learn how to use PFDS.
Coding name conventions used by PFDS.
o is a Node object
obj is a data structure object
l is a logical
s is a string
p is parent
cel is cell array
Classes use caps for start of words in class name
Methods start with lower case letter
Methods may have _moreinfo appended
Variables are lower case letters
Variables or functions with _ inside are Ok
Write readable code to reduce comment clutter
Examples in Mathworks: ToyWorld_3D, Information_Demo and testDijkstraTwoStack.
Tests.
Unit tests and testAll.m are provided.
PFDS/toolbox/test/results directory retains result files.
Watch the tests and check for yourself.
Feel free to improve them.
Nodes provided:
Node (base class for all nodes)
SingleChildNode (one parent) < Node
MultiChildNode < Node
PriorityQueueNode < SingleChildNode
BinaryTreeNode < Node
BinarySearchTreeNode < BinaryTreeNode
AVLNode < BinarySearchTreeNode
Node_3D < MultiChildNode
Part < Node_3D
Surface < Part
HeapNode < Node
Data Structures provided:
DataStructure(base class for all data Structures(
DoublyLinkedList < DataStructure
Queue < DoublyLinkedList
PriorityQueue < Queue
Stack < DoublyLinkedList
Tree < DataStructure
BinaryTree < Tree
BinarySearchTree < BinaryTree
MultiChildTree < Tree
AVLTree < BinarySearchTree
Tree_3D < MultiChildTree
Heap < DataStructure
Copyright 2024 Steve Lenk, see BSD 3-clause for details.

Cite As

Steve Lenk (2024). Programmer Friendly Data Structures (PFDS) (https://www.mathworks.com/matlabcentral/fileexchange/164691-programmer-friendly-data-structures-pfds), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2019b
Compatible with R2019b and later releases
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.3.0

"Complete" set of nodes + data structures + methods to make solutions in MATLAB. V1.3.0. Pls enjoy.

1.1.0

AVL Tree, Part, Surface added. Cleanups done.

1.0.0