Skip to content

ivanallen/dsa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Structure & Algorithm (DSA)

Build Status

DSA is a library of basic and advanced data structures, as well as common algorithms. We are committed to providing a complete and concise set of code to implement all modules.

Features

  • Modern C++ style(Based on C++17)
  • Full comments
  • Clear and pleasant API
  • Strong ability to debug

How to build

$ bash ./build.sh
$ cd build && make test

Example

The following is an easy demo showing how to create a binary tree.

#include <iostream>
#include <string_view>
#include "binary_tree.h"

using namespace dsa;
using Tree = BinaryTree<int>;

int main() {
    constexpr std::string_view tree_graph = R"(
                  1        <- right_rotate
                /   \
               2     3
             /   \
            4     5

                  ||

                  2
                /   \
               4     1
                   /   \
                  5     3
    )";

    // We can build a binary tree from list
    Tree tree({1, 2, 3, 4, 5});
    std::cout << tree << std::endl;

    // Rotate at root
    tree.right_rotate(1);

    // Print the tree
    std::cout << tree << std::endl;
    return 0;
}

Contact

  • QQ Group: 610441700

  • Dingding Group:

About

数据结构与算法

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published