Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Segment Tree Data Structure #177

Merged
merged 2 commits into from
Oct 12, 2019
Merged

Add Segment Tree Data Structure #177

merged 2 commits into from
Oct 12, 2019

Conversation

RishabhBhatnagar
Copy link
Contributor

@RishabhBhatnagar RishabhBhatnagar commented Oct 4, 2019

Description

Segment Tree is used for storing information about intervals, or segments. It allows querying which of the stored segments contain a given point.

A segment tree for a set I of n intervals uses O(n log n) storage and can be built in O(n log n) time. Segment trees support searching for all the intervals that contain a query point in O(log n + k), k being the number of retrieved intervals or segments.
\cite{https://en.m.wikipedia.org/wiki/Segment_tree }

Fixes #82

Type of change

  • New Script

Copy link
Collaborator

@senthilkumar1729 senthilkumar1729 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please provide a small description of Segment Tree at the top? 😄
The code looks good 👍 Thank you for contributing!

@RishabhBhatnagar
Copy link
Contributor Author

Can you please provide a small description of Segment Tree at the top?
The code looks good Thank you for contributing!

Description has been added.

Copy link
Member

@ionicc ionicc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add the description as a comment on the beginning of the script 😄

@RishabhBhatnagar
Copy link
Contributor Author

You could add the description as a comment on the beginning of the script

Description has been added in the file.

Copy link
Member

@ionicc ionicc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Thanks for your contribution 😄

@ionicc ionicc merged commit a36b931 into codezoned:master Oct 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more Graph Algorithms
3 participants