@@ -81,6 +81,8 @@ msgid ""
8181" that ``all(val <= x for val in a[lo:i])`` for the left side and ``all(val >"
8282" x for val in a[i:hi])`` for the right side."
8383msgstr ""
84+ "返回的插入点 *i* 可以将数组 *a* 分成两部分。左侧是 ``all(val <= x for val in a[lo:i])``,右侧是 "
85+ "``all(val > x for val in a[i:hi])`` for the right side。"
8486
8587#: ../../library/bisect.rst:49
8688msgid ""
@@ -89,12 +91,15 @@ msgid ""
8991"already sorted. Keep in mind that the O(log n) search is dominated by the "
9092"slow O(n) insertion step."
9193msgstr ""
94+ "将 *x* 插入到一个有序序列 *a* 里,并维持其有序。如果 *a* 有序的话,这相当于 "
95+ "``a.insert(bisect.bisect_left(a, x, lo, hi), x)``。要注意搜索是 O(log n) 的,插入却是 "
96+ "O(n) 的。"
9297
9398#: ../../library/bisect.rst:57
9499msgid ""
95100"Similar to :func:`insort_left`, but inserting *x* in *a* after any existing "
96101"entries of *x*."
97- msgstr ""
102+ msgstr "类似于 :func:`insort_left`,但是把 *x* 插入到 *a* 中已存在元素 *x* 的右侧。 "
98103
99104#: ../../library/bisect.rst:62
100105msgid ""
@@ -104,10 +109,14 @@ msgid ""
104109"search methods and support for a key-function. The keys are precomputed to "
105110"save unnecessary calls to the key function during searches."
106111msgstr ""
112+ "`SortedCollection recipe "
113+ "<https://code.activestate.com/recipes/577197-sortedcollection/>`_ 使用 bisect "
114+ "构造了一个功能完整的集合类,提供了直接的搜索方法和对用于搜索的 key 方法的支持。所有用于搜索的键都是预先计算的,以避免在搜索时对 key "
115+ "方法的不必要调用。"
107116
108117#: ../../library/bisect.rst:70
109118msgid "Searching Sorted Lists"
110- msgstr ""
119+ msgstr "搜索有序列表 "
111120
112121#: ../../library/bisect.rst:72
113122msgid ""
0 commit comments