Skip to content

Comments

Test2#11

Open
Volodya-Petrov wants to merge 1 commit intomainfrom
test2
Open

Test2#11
Volodya-Petrov wants to merge 1 commit intomainfrom
test2

Conversation

@Volodya-Petrov
Copy link
Owner

No description provided.

Copy link

@DedSec256 DedSec256 left a comment

Choose a reason for hiding this comment

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

4/10

Comment on lines +5 to +11
type private QueueElement(value:int, priority:int) =
let value = value
let priority = priority

member public this.Value with get () = value

member public this.Priority with get () = priority

Choose a reason for hiding this comment

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

Новое достижение открыто: Вы переизобрели record!

Suggested change
type private QueueElement(value:int, priority:int) =
let value = value
let priority = priority
member public this.Value with get () = value
member public this.Priority with get () = priority
type private QueueElement = { value:int; priority:int }

member public this.Priority with get () = priority

type public PriorityQueue () =
let mutable queue = List<QueueElement>()

Choose a reason for hiding this comment

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

по условию запрещено использовать System.Collections

raise (System.InvalidOperationException("Очередь пуста"))
else
let value = queue[0].Value
queue.RemoveAt(0)

Choose a reason for hiding this comment

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

Новое достижение открыто: Эффективость, удаление за O(n)!

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