• lower_bound() returns the position of the first element that has a v การแปล - • lower_bound() returns the position of the first element that has a v ไทย วิธีการพูด

• lower_bound() returns the positio

• lower_bound() returns the position of the first element that has a value equal to or greater than
value. This is the first position where an element with value value could get inserted without
breaking the sorting of the range [beg,end).
• upper_bound() returns the position of the first element that has a value greater than value. This
is the last position where an element with value value could get inserted without breaking the
sorting of the range [beg,end).
• All algorithms return end if there is no such value.
• op is an optional binary predicate to be used as the sorting criterion:
op(elem1,elem2)
• The caller has to ensure that the ranges are sorted according to the sorting criterion on entry.
• To obtain the result from both lower_bound() and upper_bound(), use equal_range(),
which returns both (see the next algorithm).
• Associative containers provide equivalent member functions that provide better performance (see
Section 8.3.3, page 405).
• Complexity: logarithmic for random-access iterators, linear otherwise (at most, log(numElems)
+ 1 comparisons; but for other than random-access iterators, the number of operations to step
through the elements is linear, making the total complexity linear).

The following program demonstrates how to use lower_bound() and upper_bound():






0/5000
จาก: -
เป็น: -
ผลลัพธ์ (ไทย) 1: [สำเนา]
คัดลอก!
• lower_bound() ส่งกลับค่าตำแหน่งขององค์ประกอบแรกที่มีค่าเท่ากับ หรือมากกว่า
ค่า นี้เป็นตำแหน่งแรกที่องค์ประกอบที่ มีค่าค่าสามารถรับแทรกโดย
แบ่งการเรียงลำดับของช่วง [beg,end)
• upper_bound() ส่งกลับค่าตำแหน่งขององค์ประกอบแรกที่มีค่ามากกว่าค่า นี้
เป็นตำแหน่งสุดท้ายที่องค์ประกอบที่ มีค่าค่าสามารถรับแทรก โดยแบ่งการ
เรียงลำดับของช่วง [beg,end)
•อัลกอริทึมทั้งหมดกลับสิ้นสุดไม่เช่นค่าได้
• op เป็นเพรดิเคตไบนารีตัวเลือกที่จะใช้เป็นเงื่อนไขการเรียงลำดับ:
op (elem1, elem2)
•มีผู้เรียกเพื่อให้แน่ใจว่า ช่วงจะเรียงลำดับตามเงื่อนไขการเรียงลำดับรายการ
•รับผลจาก lower_bound() และ upper_bound() ใช้ equal_range (),
ที่ส่งคืนทั้งสอง (ดูอัลกอริทึมต่อไป)
บรรจุภัณฑ์ที่เกี่ยวข้อง•มีฟังก์ชันสมาชิกเท่าที่มีประสิทธิภาพ (ดู
ส่วน 8.3.3 หน้า 405)
•ความซับซ้อน: ลอการิทึมสำหรับการเข้าถึงแบบสุ่ม iterators เส้นมิฉะนั้น (มากที่สุด log(numElems)
เปรียบเทียบ 1 แต่อื่น ๆ กว่าสุ่มเข้า iterators หมายเลขการดำเนินงานเพื่อ
ผ่านองค์ประกอบไม่เชิงเส้น ทำซับซ้อนรวมเชิงเส้น)

โปรแกรมต่อไปนี้สาธิตวิธีการใช้ lower_bound() และ upper_bound():






การแปล กรุณารอสักครู่..
ผลลัพธ์ (ไทย) 2:[สำเนา]
คัดลอก!
• lower_bound() returns the position of the first element that has a value equal to or greater than
value. This is the first position where an element with value value could get inserted without
breaking the sorting of the range [beg,end).
• upper_bound() returns the position of the first element that has a value greater than value. This
is the last position where an element with value value could get inserted without breaking the
sorting of the range [beg,end).
• All algorithms return end if there is no such value.
• op is an optional binary predicate to be used as the sorting criterion:
op(elem1,elem2)
• The caller has to ensure that the ranges are sorted according to the sorting criterion on entry.
• To obtain the result from both lower_bound() and upper_bound(), use equal_range(),
which returns both (see the next algorithm).
• Associative containers provide equivalent member functions that provide better performance (see
Section 8.3.3, page 405).
• Complexity: logarithmic for random-access iterators, linear otherwise (at most, log(numElems)
+ 1 comparisons; but for other than random-access iterators, the number of operations to step
through the elements is linear, making the total complexity linear).

The following program demonstrates how to use lower_bound() and upper_bound():






การแปล กรุณารอสักครู่..
ผลลัพธ์ (ไทย) 3:[สำเนา]
คัดลอก!
บริการ lower_bound() ส่งกลับตำแหน่งแรกขององค์ประกอบที่มีค่ามากกว่าหรือเท่ากับ
ค่า นี้เป็นตำแหน่งแรกที่องค์ประกอบที่มีมูลค่าอาจถูกแทรกโดยไม่
แบ่งการเรียงลำดับของช่วง [ ขอร้อง จบ )
- upper_bound() คืนตำแหน่งขององค์ประกอบแรกที่มีมูลค่ามากกว่าค่า นี้
เป็นตำแหน่งสุดท้ายที่เป็นธาตุที่มีมูลค่าอาจถูกแทรกโดยไม่ทำลาย
การเรียงลำดับของช่วง [ ขอร้อง จบ )
- ใช้คืนจบ ถ้าไม่มีคุณค่า
- OP คือตัวเลือกไบนารีประโยคที่จะใช้เป็นเกณฑ์การเรียง OP ( elem1 :
,
elem2 ) - โทรได้เพื่อให้แน่ใจว่าช่วงที่เรียงไว้ตามเกณฑ์ในการเรียง
รายการ- ได้รับผลจากทั้ง lower_bound() upper_bound() และใช้ equal_range()
) ทั้ง , ซึ่ง ( ดูขั้นตอนถัดไป ) .
- เชื่อมโยงภาชนะให้ฟังก์ชันสมาชิกเทียบเท่าที่ให้ประสิทธิภาพที่ดีขึ้น ( ดู
ส่วน 8.3.3 หน้า 405 )
- ความซับซ้อน : ลอการิทึมสำหรับการเข้าถึงแบบสุ่ม iterators เชิงอื่น ( ที่ส่วนใหญ่เข้าสู่ระบบ ( numelems )
1 เปรียบเทียบ ;แต่สำหรับอื่น ๆนอกเหนือจากการเข้าถึงแบบสุ่ม iterators , จํานวนของการดำเนินการขั้นตอน
ผ่านองค์ประกอบที่เป็นเส้นตรง ทำให้ความซับซ้อนรวมเชิงเส้น )

โปรแกรมต่อไปนี้แสดงให้เห็นถึงวิธีการใช้และ lower_bound() upper_bound() :






การแปล กรุณารอสักครู่..
 
ภาษาอื่น ๆ
การสนับสนุนเครื่องมือแปลภาษา: กรีก, กันนาดา, กาลิเชียน, คลิงออน, คอร์สิกา, คาซัค, คาตาลัน, คินยารวันดา, คีร์กิซ, คุชราต, จอร์เจีย, จีน, จีนดั้งเดิม, ชวา, ชิเชวา, ซามัว, ซีบัวโน, ซุนดา, ซูลู, ญี่ปุ่น, ดัตช์, ตรวจหาภาษา, ตุรกี, ทมิฬ, ทาจิก, ทาทาร์, นอร์เวย์, บอสเนีย, บัลแกเรีย, บาสก์, ปัญจาป, ฝรั่งเศส, พาชตู, ฟริเชียน, ฟินแลนด์, ฟิลิปปินส์, ภาษาอินโดนีเซี, มองโกเลีย, มัลทีส, มาซีโดเนีย, มาราฐี, มาลากาซี, มาลายาลัม, มาเลย์, ม้ง, ยิดดิช, ยูเครน, รัสเซีย, ละติน, ลักเซมเบิร์ก, ลัตเวีย, ลาว, ลิทัวเนีย, สวาฮิลี, สวีเดน, สิงหล, สินธี, สเปน, สโลวัก, สโลวีเนีย, อังกฤษ, อัมฮาริก, อาร์เซอร์ไบจัน, อาร์เมเนีย, อาหรับ, อิกโบ, อิตาลี, อุยกูร์, อุสเบกิสถาน, อูรดู, ฮังการี, ฮัวซา, ฮาวาย, ฮินดี, ฮีบรู, เกลิกสกอต, เกาหลี, เขมร, เคิร์ด, เช็ก, เซอร์เบียน, เซโซโท, เดนมาร์ก, เตลูกู, เติร์กเมน, เนปาล, เบงกอล, เบลารุส, เปอร์เซีย, เมารี, เมียนมา (พม่า), เยอรมัน, เวลส์, เวียดนาม, เอสเปอแรนโต, เอสโทเนีย, เฮติครีโอล, แอฟริกา, แอลเบเนีย, โคซา, โครเอเชีย, โชนา, โซมาลี, โปรตุเกส, โปแลนด์, โยรูบา, โรมาเนีย, โอเดีย (โอริยา), ไทย, ไอซ์แลนด์, ไอร์แลนด์, การแปลภาษา.

Copyright ©2025 I Love Translation. All reserved.

E-mail: