Final test is partly ready#15
Open
viktoriia-fomina wants to merge 12 commits into
Open
Conversation
yurii-litvinov
suggested changes
Jun 6, 2020
| for i in 0..(maxSize - 1 - 50) do | ||
| elements.[i] <- whatCopy.[i] | ||
|
|
||
| copy temp |
There was a problem hiding this comment.
А Вы уверены, что массив --- хорошая структура данных для этой задачи? :) Или Вы хотели очередь на кольцевом массиве, но что-то пошло не так?
| else elements.[0] | ||
|
|
||
| /// Enqueue an element. | ||
| member this.Enqueu value = |
| count <- count + 1 | ||
|
|
||
| /// Dequeu the first element. | ||
| member this.Dequeu() = |
| let mutable i = 1 | ||
| let mutable sum = 0 | ||
|
|
||
| while (fibonacci i) < 1000000 do |
There was a problem hiding this comment.
Это каждое число Фибоначчи заново с нуля считается, хотя они все легко вычисляются через друг друга. Можно через seq и yield :)
|
|
||
| [<Test>] | ||
| let ``Enqueue and peek test 4`` () = | ||
| let q = new Queue() |
There was a problem hiding this comment.
Это в TestInitialize надо бвы вынести
yurii-litvinov
approved these changes
Jun 6, 2020
yurii-litvinov
left a comment
There was a problem hiding this comment.
Кривовато, но работать должно. Зачтены
|
|
||
| /// Resizes the queue. | ||
| let resize () = | ||
| maxSize <- maxSize + 50 |
There was a problem hiding this comment.
Если уж делать resize, то вдвое (это влияет на асимптотику --- есть большая разница, прибавлять 50 или умножать на 2)
|
|
||
| [<Test>] | ||
| let ``Enqueue and peek test 4`` () = | ||
| let q = new Queue<int>() |
There was a problem hiding this comment.
Это можно было бы вынести в SetUp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.