Week 4 Flashcards
What’s a queue?
A first-in first-out structure of a list.
What does the enqueue function do?
The addition of an item to the end of the queue.
What does the dequeue function do?
Removes an item from the front of the queue.
What’s a stack?
A stack is a last-in first-out structure.
What does the push function do?
Addition of an element to the of the stack
What does the pop function do?
The removal of an element from the top of the stack.
What is a dictionary?
A collection of pairs with a key and a value.
What is a set?
A set is a datatype to which we can add or remove elements and we can check if an element is in the set or not. Sets are not ordered.
What is unit testing?
The process of testing program components such as methods or object classes.
How do use use visual studios to create a test method?
[TestClass()]
public class MyMathTests
{
[TestMethod()]
public void AddTest()
{
How do use use visual studios to create a test method?
[TestClass()]
public class MyMathTests
{
[TestMethod()]
public void AddTest()
{
int x = 1;
int y = -5;
//Act
int result = MyMatg.Add(x,y);
//Assertion
Assert.AreEqual(-4,result);
}
}
What does the Assert.Fail(); method do?
Always fails, a usual first assertion provided by the skeleton.
Other assert methods
AreEqual, AreNotEqual, IsFalse, IsTrue, IsNotNull