Skip to content

Commit 2537eff

Browse files
committed
Fixing quiz #2 layout.
1 parent 974afc5 commit 2537eff

1 file changed

Lines changed: 33 additions & 33 deletions

File tree

source/solutions/data/lists.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -46,46 +46,46 @@ tags:
4646
4747
#. … a `IsEmpty` property that is `true` if the `CList` calling object is empty.
4848

49-
<details>
50-
<summary>Solution</summary>
51-
52-
Note that the question asks for a *property*:
53-
54-
```
55-
public bool IsEmpty{
56-
get{ return first == null; }
57-
}
58-
```
59-
</details>
49+
<details>
50+
<summary>Solution</summary>
51+
52+
Note that the question asks for a *property*:
53+
54+
```
55+
public bool IsEmpty{
56+
get{ return first == null; }
57+
}
58+
```
59+
</details>
6060

6161
#. … the `AddF` method that add a cell at the beginning of the CList (to the left).
6262

63-
<details>
64-
<summary>Solution</summary>
63+
<details>
64+
<summary>Solution</summary>
6565

66-
The key is to use the given `Cell` constructor to create the new element:
67-
68-
```
69-
public void AddF(T dataP){
70-
first = new Cell(dataP, first);
71-
}
72-
```
73-
</details>
66+
The key is to use the given `Cell` constructor to create the new element:
67+
68+
```
69+
public void AddF(T dataP){
70+
first = new Cell(dataP, first);
71+
}
72+
```
73+
</details>
7474

7575
#. … a series of statements, to be inserted in a `Main` method, that a. create a `CList` object capable of containing `char`, b. insert the elements `'b'` and `'/'` in it, c. displays whether it is empty using `IsEmpty`.
7676

77-
<details>
78-
<summary>Solution</summary>
79-
80-
Remembering that `IsEmpty` is a property, we obtain:
81-
82-
```
83-
CList<char> myList1 = new CList<char>();
84-
myList1.AddF('b');
85-
myList1.AddF('/');
86-
Console.WriteLine("myList1 is empty:" + myList1.IsEmpty);
87-
```
88-
</details>
77+
<details>
78+
<summary>Solution</summary>
79+
80+
Remembering that `IsEmpty` is a property, we obtain:
81+
82+
```
83+
CList<char> myList1 = new CList<char>();
84+
myList1.AddF('b');
85+
myList1.AddF('/');
86+
Console.WriteLine("myList1 is empty:" + myList1.IsEmpty);
87+
```
88+
</details>
8989

9090
#. Briefly explain the purpose of the `IsReadonly` property from the `ICollection<T>` interface, and list at least two methods in a List implementation realizing `ICollection<T>` that should use it.
9191

0 commit comments

Comments
 (0)