Skip to content

MedivhGO/MyCPP

Repository files navigation

用 C++ 实现常用的数据结构和算法

TODO

  • 实现MyString
  • 实现MySharedPtr
  • 实现MyWeakPtr
  • 实现MyUniquePtr
  • 实现MutexLock
  • 实现MyMatrix(strassen实现矩阵乘法)
  • 实现Singleton
  • 实现MyBST(binary search tree)
  • 实现MyError
  • 实现MyHashMap
  • 实现常见的排序算法以及二分查找
  • 实现MyFileReader
  • 实现MyFileWriter
  • 实现MyRBTree
  • 实现MyProfiler
  • 实现MyVector
  • 实现MySkipList

dependencies

to support C++ 20 feature

  • required gcc-10 g++-10 or higher
  • required cmake 3.21 or higher

build

git clone https://github.com/MedivhGO/MyCPP.git
cd MyCPP
mkdir build
cd build
cmake ..
make

modify test/CMakeList.txt file to generate correspond single unit test executable file.

add below code:

  • add_executable

  • target_link_libraries

run

cd build/test
./test_case.test

valgrind

to check memory leak, you can use blow command.

/usr/bin/valgrind --leak-check=full --leak-resolution=med --track-origins=yes --vgdb=no ./build/test/MyCpp.test

profiler

// use MyProfile.h measure function to get runtime data
// example
 measure(function_name, param1, param2).count()

References

See also:

Releases

No releases published

Packages

No packages published

Languages