-
Notifications
You must be signed in to change notification settings - Fork 0
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
Final test is partly ready #15
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А тесты на Фибоначчи? :)
for i in 0..(maxSize - 1 - 50) do | ||
elements.[i] <- whatCopy.[i] | ||
|
||
copy temp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А Вы уверены, что массив --- хорошая структура данных для этой задачи? :) Или Вы хотели очередь на кольцевом массиве, но что-то пошло не так?
else elements.[0] | ||
|
||
/// Enqueue an element. | ||
member this.Enqueu value = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enqueue
count <- count + 1 | ||
|
||
/// Dequeu the first element. | ||
member this.Dequeu() = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dequeue, и пробел нужен
let mutable i = 1 | ||
let mutable sum = 0 | ||
|
||
while (fibonacci i) < 1000000 do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это каждое число Фибоначчи заново с нуля считается, хотя они все легко вычисляются через друг друга. Можно через seq и yield :)
|
||
[<Test>] | ||
let ``Enqueue and peek test 4`` () = | ||
let q = new Queue() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это в TestInitialize надо бвы вынести
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Кривовато, но работать должно. Зачтены
|
||
/// Resizes the queue. | ||
let resize () = | ||
maxSize <- maxSize + 50 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Если уж делать resize, то вдвое (это влияет на асимптотику --- есть большая разница, прибавлять 50 или умножать на 2)
|
||
[<Test>] | ||
let ``Enqueue and peek test 4`` () = | ||
let q = new Queue<int>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это можно было бы вынести в SetUp
No description provided.