Giter Club home page Giter Club logo

tree-bracket-representation's Introduction

tree-bracket-representation

Test & Lint all

Reading and writing of a string tree bracket representation in multiple programming languages.

What is this project about?

It is a simple hoby project, created mainly to learn new tools, languages and to be able to directly compare pros and cons of each language. So there will be many solutions in the repo, divided by programming languages, e.g. java and go.

The goal of the program is to read and write tree structure from a bracket string representation. Read more on the representation from this link but bare in mind that this library supports reading and writing of general trees as well.

For example, the below tree:

        A
    /   |   \
  CD    E    I
       / \
      F   G

could simply be presented as:

A(CD)(E(F)(G))(I)

on the other hand, here are some examples of invalid tree strings:

A(CD)a      // there is undefined node a
()          // two errors: the root node and its first child have no name
(A)         // the root node has no name

See more valid and invalid examples in the files used for tests across different implementations in ./examples folder.

Requirements

Each language should add support for the following function:

  • object constructor: parses a bracket tree string representation to an internal object structure and stores initial bracket tree string
  • find("A"): finds the first occurrence of node with name A and returns object presentation of the node
  • addChild("D(C(M))(L)"): adds child D to the tree node
  • countLeaves(): returns a number of nodes that have no children
  • toBracketRepresentation(): converts the internal object structure back to bracket tree string representation

For each language there should also be:

  • written tests that read invalid and valid test cases from JSON files stored in ./examples folder.
  • a linting tool to be added to check for code style.
  • the execution of tests and lint tool should be included in GitHub Actions workflow file.
  • written README.md file with status and example usage

How to use?

Check each for a README file in each language's folder.

tree-bracket-representation's People

Contributors

renovate[bot] avatar urgas9 avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

tree-bracket-representation's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • Update Rust crate serde to v1.0.208
  • Update Rust crate serde_json to v1.0.125
  • Update plugin org.jetbrains.kotlin.jvm to v1.9.25
  • Update dependency com.google.code.gson:gson to v2.11.0
  • Update dependency flake8 to v7.1.1
  • Update dependency gradle to v8.10
  • Update dependency mypy to v1.11.1
  • Update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.4.0
  • Update dependency pytest to v8.3.2
  • Update junit5 monorepo to v5.11.0 (org.junit.jupiter:junit-jupiter-params, org.junit.jupiter:junit-jupiter-engine, org.junit.jupiter:junit-jupiter-api)
  • Update plugin org.jetbrains.kotlin.jvm to v2

Detected dependencies

cargo
rust/Cargo.toml
  • serde 1.0.200
  • serde_json 1.0.116
github-actions
.github/workflows/main.yml
  • actions/checkout v4
  • actions/setup-java v4
  • actions/checkout v4
  • actions/setup-go v5
  • actions/checkout v4
  • actions/setup-python v5
  • actions/checkout v4
  • actions/setup-java v4
  • actions/checkout v4
  • actions-rs/toolchain v1
gomod
go/go.mod
  • go 1.19
  • github.com/stretchr/testify v1.9.0
gradle
kotlin/gradle.properties
kotlin/settings.gradle
kotlin/build.gradle
  • org.jetbrains.kotlin.jvm 1.9.23
  • org.jlleitschuh.gradle.ktlint 12.1.1
  • org.junit.jupiter:junit-jupiter-api 5.10.3
  • org.junit.jupiter:junit-jupiter-engine 5.10.3
  • org.junit.jupiter:junit-jupiter-params 5.10.3
  • com.google.code.gson:gson 2.10.1
gradle-wrapper
kotlin/gradle/wrapper/gradle-wrapper.properties
  • gradle 8.7
maven
java/pom.xml
  • com.google.code.gson:gson 2.10.1
  • org.junit.jupiter:junit-jupiter-api 5.10.3
  • org.junit.jupiter:junit-jupiter-engine 5.10.3
  • org.junit.jupiter:junit-jupiter-params 5.10.3
  • org.apache.maven.plugins:maven-surefire-plugin 3.2.5
  • com.github.spotbugs:spotbugs-maven-plugin 4.8.6.2
  • com.github.spotbugs:spotbugs 4.8.6
pip_setup
python/setup.py
  • pytest ==8.2.0
  • mypy ==1.10.1
  • flake8 ==7.0.0
  • flake8-quotes ==3.4.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.