Skip to content

Commit 19a03ee

Browse files
Update README.md
1 parent 12960f5 commit 19a03ee

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,33 @@
44

55
2. Write a function that takes a BitSet and returns the number of steps needed to shift all `1` bits to the left (maintaining the same `length()` of the BitSet).
66

7-
3. Write a function that takes a BitSet and returns the number of steps needed to shift all `1` bits to the right.
7+
3. Write a function that takes a BitSet and returns the number of steps needed to shift all `1` bits to the right.
8+
9+
## Stack Microlab
10+
11+
A stack is a data structure that stores a list of elements. Each element is added with the `push(element)` method and the most recent element can be retreived with the `pop()` method. The `peek()` method returns the top element on the stack without removing it from the stack. The **last** element put **in** the stack is the **first** one to come **out** -- this is why it's called a **Last In First Out** (LIFO) data structure.
12+
13+
Create your own Stack for Strings called `StringStack` and implement these three methods.
14+
15+
**Part 2**:
16+
17+
Generalize your StringStack to a generic Stack implementation. It should include appropriate type parameters and allow storage of any object type.
18+
19+
*hint*: There may be another existing collection that is useful for implementing a stack.
20+
21+
## Listbuilder
22+
23+
Create a ListBuilder interface with one method: `buildList(Array a):List`
24+
25+
Implement the interface and its method with the following classes:
26+
27+
- `ArrayListBuilder` -- Creates an ArrayList from the given array
28+
- `LinkedListBuilder` -- Creates a LinkedList from the given array
29+
30+
Part 2: Override `buildList` with `buildList(Collection c):List` to take any collection type and produce the corresponding List type to the implementing class (just like part one). You may want to look at the `Collection.toArray()` method for this.
31+
32+
33+
## Iterator
34+
35+
Create an `Iterator` that produces the Fibonacci series; call it `FibonacciIterator`. The `hasNext()` method should always return true because the Fibonacci series is an infinite set.
36+

0 commit comments

Comments
 (0)