Skip to content

Commit 052d7bf

Browse files
committed
translate into english
1 parent be7cdde commit 052d7bf

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

C10-Elementary-Data-Structures/10.1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Using Figure 10.2 as a model, illustrate the result of each operation in the seq
7070
Rewrite ENQUEUE and DEQUEUE to detect underflow and overflow of a queue.
7171

7272
### `Answer`
73-
在开头加上
73+
Add at the beginning:
7474

7575
ENQUEUE(Q, x):
7676
if head[Q] == tail[Q] + 1

C10-Elementary-Data-Structures/10.2.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Can the dynamic-set operation INSERT be implemented on a singly linked list in O
44

55

66
### `Answer`
7-
插入的话可以直接插入在开头,删除的话需要遍历.
7+
INSERT - words can be insterted direclty at the beginning, DELETE - it requires to traverse whole list.
88

99

1010
### Exercises 10.2-2
@@ -13,7 +13,7 @@ Implement a stack using a singly linked list L. The operations PUSH and POP shou
1313
take O(1) time.
1414

1515
### `Answer`
16-
PUSH插入到链表头,POP从链表头操作,都是O(1).
16+
PUSH - make element list's head,POP - remove list's had,both operations take O(1).
1717

1818
### Exercises 10.2-3
1919
***
@@ -22,8 +22,10 @@ should still take O(1) time.
2222

2323
### `Answer`
2424

25-
* ENQUEUE插入到链表尾
26-
* DEQUEUE从链表头取出
25+
Keep two pointers: one will point to beginning of the list, other to the end.
26+
27+
* ENQUEUE - insert into end of the list,
28+
* DEQUEUE - remove list's head
2729

2830
### Exercises 10.2-4
2931
***

0 commit comments

Comments
 (0)