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

Final test is partly ready #15

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Final test is partly ready #15

wants to merge 12 commits into from

Conversation

viktoriia-fomina
Copy link
Owner

No description provided.

Copy link

@yurii-litvinov yurii-litvinov left a 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

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 =

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() =

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

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()

Choose a reason for hiding this comment

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

Это в TestInitialize надо бвы вынести

Copy link

@yurii-litvinov yurii-litvinov left a 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

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>()

Choose a reason for hiding this comment

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

Это можно было бы вынести в SetUp

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