summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-05-18 15:51:04 -0600
committermo khan <mo.khan@gmail.com>2020-05-18 15:51:04 -0600
commit047f7e13450b6049b0f9bd10e6f5950fd964ff0e (patch)
tree28bcdd708bdaaad243fe24cafd415d9ace6cdc93
parent5bb9efe27652283e40c2aed3c3bdbf45a6bb68e1 (diff)
Format sub bullets
-rw-r--r--assignments/01/README.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/assignments/01/README.md b/assignments/01/README.md
index 002b64f..e024ecb 100644
--- a/assignments/01/README.md
+++ b/assignments/01/README.md
@@ -4,11 +4,11 @@ Answer question 1, question 2, and any other 2 questions from questions 3 to 6 â
You must score at least 50 to pass the assignment.
1. You have learned some fundamental data structure concepts such as array, queue and priority queue, stack, list and linked list, sequence, and unordered set, and you understand the concept of interface or abstract data type that defines the set of operations supported by a data structure and the semantics, or meaning, of those operations. You can use the interface of one particular data structure to define or implement the operations of a different data structure.
- a. Describe the meaning of the essential methods `add(x)`, `deleteMin()`, and `size()` that are supported by the priority queue interface. Implement those methods using a singly-linked list. Analyze the running time of the `add(x)` and `deletMin()` operations based on this implementation.
- b. Implement the stack methods `push(x)` and `pop()` using two queues. Analyze the running time of the `push(x)` and `pop()` operations based on this implementation.
+ * a. Describe the meaning of the essential methods `add(x)`, `deleteMin()`, and `size()` that are supported by the priority queue interface. Implement those methods using a singly-linked list. Analyze the running time of the `add(x)` and `deletMin()` operations based on this implementation.
+ * b. Implement the stack methods `push(x)` and `pop()` using two queues. Analyze the running time of the `push(x)` and `pop()` operations based on this implementation.
2. Swap two adjacent elements in a list by adjusting only the links (and not the data) using:
- a. singly-linked list.
- b. doubly-linked list.
+ * a. singly-linked list.
+ * b. doubly-linked list.
3. Using a `USet`, implement a `Bag`. A `Bag` is like a `USet` - it supports the `add(x)`, `remove(x)`, and `find(x)` methods - but it allows duplicate elements to be stored.
The `find(x)` operation in a Bag returns some element (if any) that is equal to x.
In addition, a `Bag` supports the `findAll(x)` operation that returns a list of all elements in the Bag that are equal to x.