WebClub-NITK / WebClub-NITK/Hacktoberfest-2k21

Distinct Subtrees

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
Algorithms Beginner Hacktoberfest
Dominant language
Jupyter Notebook
Stars
1
Forks
7
PR merge metrics
No merged PRs in 30d

Description

### Description
Given a binary tree with ```N``` vertices, count the number of distinct subtrees. The tree will be rooted at vertex 1, and each vertex will have a value ```val``` associated with it (not necessarily distinct).

Note that two subtrees are considered duplicates if they have the same structure and values.

#### Constraints
1 <= N <= 10000
1 <= val <= 500

### Details
- Technical Specifications: C/C++/Python
- Type of issue: Single
- Time Limit: 1 day after being assigned the issue

### Issue requirements / progress
- [ ] The solution must be efficient in terms of space and time complexity

### Directory Structure
Create a folder named "distinct_subtrees" in the Algorithms folder and add your files in it.

#### Note
1. Please claim the issue first by commenting here before starting to work on it.
2. Once you are done with the task and have created a Pull Request, please tag @spectre900 to request a review.

Contributor guide

Open the contributing guide

Research direction

Review the Algorithms directory and create the requested distinct_subtrees folder with a C, C++, or Python solution. Use the stated constraints to assess time and space efficiency, and consider the work complete when the implementation counts distinct rooted subtrees by structure and vertex values.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp, python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.