DStruct is a portable and structurally simple data structure template library.
Features - Usage - Core - Who is using - Other - ไธญๆ |
---|
Design Philosophy - Interface Documentation - Static Memory Allocator (SMA) - Porting Guide - Related Videos |
- Easily portable, no dependent std-lib
- Easy to use, like std-lib style
- Easy to learn, customize, and improve
- Provides custom allocators interface
- Supports bare-metal/small-memory devices
- Provides simple static memory management/allocator - SMA
- Modern C++/generic structures
- Download the source code to your local machine.
- Add the root directory of the DStruct library to your include path.
- Customize allocator & implement the dstruct-port.h interface - optional
#include <iostream>
#include <dstruct.hpp>
int main() {
dstruct::Array<int, 10> arr(2);
decltype(arr)::ValueType val = 6;
arr[0] = arr[-1] = val;
for (int i = 0; i < arr.size(); i++) {
std::cout << arr[-(i + 1)] << " : " << arr[i] << std::endl;
}
return 0;
}
Use static memory SMA, support no memory management environment (such as: bare metal)
#include <dstruct.hpp>
int main() {
//dstruct::Vector<int> dVec;
dstruct::smemory::Vector<int> sVec;
for (int i = 0; i < 10; i++) {
sVec.push_back(i);
}
for (auto v : sVec)
DSTRUCT_ASSERT(v == i++);
while (!sVec.empty()) {
sVec.pop_back();
}
return 0;
}
Note: Static data structures are defined in the dstruct::smemory
space, and interfaces and usage are the same as the data structures supported by dynamic memory
.
โโโ algorithm.hpp
โโโ common.hpp
โโโ ds
โ โโโ array
โ โ โโโ Array.hpp
โ โ โโโ Vector.hpp
โ โโโ Heap.hpp
โ โโโ linked-list
โ โ โโโ DoublyLinkedList.hpp
โ โ โโโ EmbeddedList.hpp
โ โ โโโ LinkedList.hpp
โ โ โโโ SinglyLinkedList.hpp
โ โโโ queue
โ โ โโโ DoubleEndedQueue.hpp
โ โ โโโ Queue.hpp
โ โโโ stack
โ โ โโโ Stack.hpp
โ โ โโโ XValueStack.hpp
โ โโโ tree
โ โโโ BinarySearchTree.hpp
โ โโโ BinaryTree.hpp
โ โโโ EmbeddedBinaryTree.hpp
โ โโโ tree-base.hpp
โโโ Iterator.hpp
โโโ StaticMemAllocator.hpp
โโโ types.hpp
- DSVisual๏ผ Data structure visualization library
- KHistory๏ผ Cross-platform key detection/history visualization tool