Skip to content

Add Set implementation based on red-black tree - #16

Open
EStarikov wants to merge 11 commits into
Lamagraph:mainfrom
EStarikov:redblackset
Open

EStarikov wants to merge 11 commits into
Lamagraph:mainfrom
EStarikov:redblackset

Conversation

@EStarikov

Copy link
Copy Markdown

No description provided.

@gsvgit gsvgit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ну и конфликты при rebase-е всё ещё.

Comment thread QuadTree/RedBlackSet.fs Outdated

let private justTree resultTree =
match resultTree with
| Done t -> t

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Можно просто | Done t | ToDo t -> t

Comment thread QuadTree/RedBlackSet.fs Outdated
| Empty
| Node of color: Color * left: Tree<'T> * value: 'T * right: Tree<'T>

let emptySet = Empty

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Попробуйте максимально разделить множество как абстракцию и конкретное дерево как один из способов реализовать.

Comment thread QuadTree/RedBlackSet.fs Outdated
match newLeft with
| Done nl -> Done(Node(Black, nl, y, c))
| ToDo nl -> ToDo(Node(Black, nl, y, c))
| _ -> failwith "Impossible pattern"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Посмотрте внимательно в существующи код. Мы стараемся не использовать failwith. Используем Result.

@EStarikov EStarikov changed the title Redblackset Add Set implementation based on red-black tree Sep 16, 2026
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.

2 participants