Skip to content

Final test is partly ready#15

Open
viktoriia-fomina wants to merge 12 commits into
masterfrom
FinalTest
Open

Final test is partly ready#15
viktoriia-fomina wants to merge 12 commits into
masterfrom
FinalTest

Conversation

@viktoriia-fomina
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

А Вы уверены, что массив --- хорошая структура данных для этой задачи? :) Или Вы хотели очередь на кольцевом массиве, но что-то пошло не так?

Comment thread FinalTest/FinalTest/FinalTest/Queue.fs Outdated
else elements.[0]

/// Enqueue an element.
member this.Enqueu value =
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Enqueue

Comment thread FinalTest/FinalTest/FinalTest/Queue.fs Outdated
count <- count + 1

/// Dequeu the first element.
member this.Dequeu() =
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown

@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
Copy link
Copy Markdown

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>()
Copy link
Copy Markdown

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