• 2021-04-14 问题

    中国大学MOOC: 下面给出了活动选择问题的算法的伪代码,其中空白处应分别填入____ 输入:活动集合 http://edu-image.nosdn.127.net/_PhotoUploadUtils_4075c80b-3add-427e-889d-fa74ed951d92.png,每个活动的起止时间http://edu-image.nosdn.127.net/_PhotoUploadUtils_ef7ece06-2c3e-4d02-9d0f-3ab579127bad.png输出:不冲突活动的最大子集http://edu-image.nosdn.127.net/_PhotoUploadUtils_dc19edf9-c972-4191-9cc6-6162970a670e.png将活动按照结束时间升序排序,使http://edu-image.nosdn.127.net/_PhotoUploadUtils_25682d8f-efcf-4584-a9c6-6d273d16210e.png表示结束时间第http://edu-image.nosdn.127.net/_PhotoUploadUtils_5a19ba86-4d85-44bc-aa33-6bd96cf3c323.png小的活动http://edu-image.nosdn.127.net/_PhotoUploadUtils_76a09a27-0376-4b72-9119-7e10b120d1bc.pnghttp://edu-image.nosdn.127.net/_PhotoUploadUtils_32f6328f-b3af-4a1f-9198-d058c8a6b772.pngfor http://edu-image.nosdn.127.net/_PhotoUploadUtils_01262698-ddb4-4d72-ad6a-6c7345403a83.png do if then http://edu-image.nosdn.127.net/_PhotoUploadUtils_da2cd9a5-6b16-4a9c-b209-dada37a4be95.png endendreturn http://edu-image.nosdn.127.net/_PhotoUploadUtils_142f3d2c-607a-4ff6-aec1-5443ff0089d3.png

    中国大学MOOC: 下面给出了活动选择问题的算法的伪代码,其中空白处应分别填入____ 输入:活动集合 http://edu-image.nosdn.127.net/_PhotoUploadUtils_4075c80b-3add-427e-889d-fa74ed951d92.png,每个活动的起止时间http://edu-image.nosdn.127.net/_PhotoUploadUtils_ef7ece06-2c3e-4d02-9d0f-3ab579127bad.png输出:不冲突活动的最大子集http://edu-image.nosdn.127.net/_PhotoUploadUtils_dc19edf9-c972-4191-9cc6-6162970a670e.png将活动按照结束时间升序排序,使http://edu-image.nosdn.127.net/_PhotoUploadUtils_25682d8f-efcf-4584-a9c6-6d273d16210e.png表示结束时间第http://edu-image.nosdn.127.net/_PhotoUploadUtils_5a19ba86-4d85-44bc-aa33-6bd96cf3c323.png小的活动http://edu-image.nosdn.127.net/_PhotoUploadUtils_76a09a27-0376-4b72-9119-7e10b120d1bc.pnghttp://edu-image.nosdn.127.net/_PhotoUploadUtils_32f6328f-b3af-4a1f-9198-d058c8a6b772.pngfor http://edu-image.nosdn.127.net/_PhotoUploadUtils_01262698-ddb4-4d72-ad6a-6c7345403a83.png do if then http://edu-image.nosdn.127.net/_PhotoUploadUtils_da2cd9a5-6b16-4a9c-b209-dada37a4be95.png endendreturn http://edu-image.nosdn.127.net/_PhotoUploadUtils_142f3d2c-607a-4ff6-aec1-5443ff0089d3.png

  • 2022-06-16 问题

    下述伪代码希望求出数组[img=50x25]1803dee1b47efb7.png[/img]中数字[img=11x14]1803dee1bd9c679.png[/img]出现的次数,则伪代码空白处应填入______输入:数组[img=50x25]1803dee1c5fa196.png[/img],数字[img=11x14]1803dee1cdce2c1.png[/img]输出:[img=11x14]1803dee1d69136d.png[/img]在数组[img=10x14]1803dee1dfa3b06.png[/img]中出现的次数[img=74x18]1803dee1e8ef471.png[/img]for [img=44x18]1803dee1f10e3c4.png[/img] to [img=11x14]1803dee1f9a31fc.png[/img] if [img=60x25]1803dee2020e421.png[/img] then ________ endendreturn [img=37x14]1803dee20a65960.png[/img] A: [img=125x20]1803dee21285a2a.png[/img] B: [img=125x20]1803dee21acc3f8.png[/img] C: [img=102x14]1803dee22411f3f.png[/img] D: [img=74x18]1803dee22cd85b2.png[/img]

    下述伪代码希望求出数组[img=50x25]1803dee1b47efb7.png[/img]中数字[img=11x14]1803dee1bd9c679.png[/img]出现的次数,则伪代码空白处应填入______输入:数组[img=50x25]1803dee1c5fa196.png[/img],数字[img=11x14]1803dee1cdce2c1.png[/img]输出:[img=11x14]1803dee1d69136d.png[/img]在数组[img=10x14]1803dee1dfa3b06.png[/img]中出现的次数[img=74x18]1803dee1e8ef471.png[/img]for [img=44x18]1803dee1f10e3c4.png[/img] to [img=11x14]1803dee1f9a31fc.png[/img] if [img=60x25]1803dee2020e421.png[/img] then ________ endendreturn [img=37x14]1803dee20a65960.png[/img] A: [img=125x20]1803dee21285a2a.png[/img] B: [img=125x20]1803dee21acc3f8.png[/img] C: [img=102x14]1803dee22411f3f.png[/img] D: [img=74x18]1803dee22cd85b2.png[/img]

  • 2021-04-14 问题

    中国大学MOOC: 在最大子数组问题的动态规划算法中,给出查找解部分的伪代码如下,空白处应填入__ _输入:数组 http://edu-image.nosdn.127.net/_PhotoUploadUtils_2dc33d8d-aba9-478c-bcf1-48f416f7a647.png,数组长度http://edu-image.nosdn.127.net/_PhotoUploadUtils_95932845-8910-4ec1-bd25-ec507a80b072.png输出:最大子数组和http://edu-image.nosdn.127.net/_PhotoUploadUtils_5a7ec370-60cc-4ff3-ad67-e6c72b7b18c0.png,子数组起止位置http://edu-image.nosdn.127.net/_PhotoUploadUtils_97864e64-115b-4239-95a6-37344bb745ea.png新建一维数组http://edu-image.nosdn.127.net/_PhotoUploadUtils_bc09e629-26b5-4851-80e1-bf7288d069e3.png和http://edu-image.nosdn.127.net/_PhotoUploadUtils_b87582bf-f5a8-4366-882e-9724ce336c3b.png对http://edu-image.nosdn.127.net/_PhotoUploadUtils_36125ae7-8e52-4d25-96e2-26a953701a81.png初始化计算http://edu-image.nosdn.127.net/_PhotoUploadUtils_d224a274-3780-4dc9-aebd-5ab7771c8c39.png数组和http://edu-image.nosdn.127.net/_PhotoUploadUtils_f911904f-716d-43f6-9b91-a5963cb87b2f.png数组//查找解http://edu-image.nosdn.127.net/_PhotoUploadUtils_738074c5-3c22-4fb1-bc30-07f6c731077e.png for http://edu-image.nosdn.127.net/_PhotoUploadUtils_15411708-e009-43d1-ac71-d313ac84285e.png do if http://edu-image.nosdn.127.net/_PhotoUploadUtils_60dd9055-6533-4310-b211-6c55a73146b9.png then http://edu-image.nosdn.127.net/_PhotoUploadUtils_e942e31c-6193-4fe1-8124-4799e6b3485a.png http://edu-image.nosdn.127.net/_PhotoUploadUtils_3734f789-a029-4889-9020-70c07ee395b9.png http://edu-image.nosdn.127.net/_PhotoUploadUtils_76d302a1-57c3-438a-a037-425d570c425b.png endendreturn http://edu-image.nosdn.127.net/_PhotoUploadUtils_0ebe1ecc-f49d-4275-a0a2-10e41127b5ee.png

    中国大学MOOC: 在最大子数组问题的动态规划算法中,给出查找解部分的伪代码如下,空白处应填入__ _输入:数组 http://edu-image.nosdn.127.net/_PhotoUploadUtils_2dc33d8d-aba9-478c-bcf1-48f416f7a647.png,数组长度http://edu-image.nosdn.127.net/_PhotoUploadUtils_95932845-8910-4ec1-bd25-ec507a80b072.png输出:最大子数组和http://edu-image.nosdn.127.net/_PhotoUploadUtils_5a7ec370-60cc-4ff3-ad67-e6c72b7b18c0.png,子数组起止位置http://edu-image.nosdn.127.net/_PhotoUploadUtils_97864e64-115b-4239-95a6-37344bb745ea.png新建一维数组http://edu-image.nosdn.127.net/_PhotoUploadUtils_bc09e629-26b5-4851-80e1-bf7288d069e3.png和http://edu-image.nosdn.127.net/_PhotoUploadUtils_b87582bf-f5a8-4366-882e-9724ce336c3b.png对http://edu-image.nosdn.127.net/_PhotoUploadUtils_36125ae7-8e52-4d25-96e2-26a953701a81.png初始化计算http://edu-image.nosdn.127.net/_PhotoUploadUtils_d224a274-3780-4dc9-aebd-5ab7771c8c39.png数组和http://edu-image.nosdn.127.net/_PhotoUploadUtils_f911904f-716d-43f6-9b91-a5963cb87b2f.png数组//查找解http://edu-image.nosdn.127.net/_PhotoUploadUtils_738074c5-3c22-4fb1-bc30-07f6c731077e.png for http://edu-image.nosdn.127.net/_PhotoUploadUtils_15411708-e009-43d1-ac71-d313ac84285e.png do if http://edu-image.nosdn.127.net/_PhotoUploadUtils_60dd9055-6533-4310-b211-6c55a73146b9.png then http://edu-image.nosdn.127.net/_PhotoUploadUtils_e942e31c-6193-4fe1-8124-4799e6b3485a.png http://edu-image.nosdn.127.net/_PhotoUploadUtils_3734f789-a029-4889-9020-70c07ee395b9.png http://edu-image.nosdn.127.net/_PhotoUploadUtils_76d302a1-57c3-438a-a037-425d570c425b.png endendreturn http://edu-image.nosdn.127.net/_PhotoUploadUtils_0ebe1ecc-f49d-4275-a0a2-10e41127b5ee.png

  • 2022-06-12 问题

    对于包含[img=69x25]1803dee74863dfb.png[/img]个正数元素的数组[img=54x25]1803dee75013ec4.png[/img],我们希望找出数组中的一些元素,使得这些元素在数组中互不相邻并且元素之和最大。例如在数组[img=75x25]1803dee757e6d00.png[/img]中,应当选择[img=33x25]1803dee760331fd.png[/img]和[img=33x25]1803dee767b1800.png[/img],元素之和为[img=18x18]1803dee76f6ce17.png[/img]。给出该问题的解决算法如下,空白处应填入____输入:正数数组[img=14x19]1803dee77816338.png[/img],元素个数[img=11x14]1803dee780ab3c0.png[/img]输出:选择的元素,最大不相邻元素之和创建数组[img=49x25]1803dee78908872.png[/img],[img=25x25]1803dee791533d8.png[/img]表示数组[img=49x25]1803dee79999d04.png[/img]中的最大不相邻元素之和创建数组[img=70x25]1803dee7a1c0f34.png[/img]记录选择方案[img=88x25]1803dee7a9d7046.png[/img][img=179x25]1803dee7b2c94ef.png[/img]if[img=126x25]1803dee7bb69c17.png[/img] then[img=130x25]1803dee7c3e0d95.png[/img][img=86x25]1803dee7cc17682.png[/img][img=86x25]1803dee7d4bf257.png[/img][img=72x25]1803dee7dd6730b.png[/img] endelse[img=51x25]1803dee7e5c8f09.png[/img] [img=86x25]1803dee7ee5a9f8.png[/img] [img=86x25]1803dee7f64585d.png[/img] [img=86x25]1803dee7fe9ae54.png[/img]endfor[img=82x18]1803dee806bc6b6.png[/img] doif then [img=84x25]1803dee80f88210.png[/img]endelse[img=101x25]1803dee81864d13.png[/img][img=84x25]1803dee820dcc1a.png[/img]endendreturn [img=65x25]1803dee82886a45.png[/img] A: [img=390x25]1803dee833a7746.png[/img] B: [img=390x25]1803dee83ef03f5.png[/img] C: [img=414x25]1803dee849caffa.png[/img] D: [img=390x25]1803dee856875dc.png[/img]

    对于包含[img=69x25]1803dee74863dfb.png[/img]个正数元素的数组[img=54x25]1803dee75013ec4.png[/img],我们希望找出数组中的一些元素,使得这些元素在数组中互不相邻并且元素之和最大。例如在数组[img=75x25]1803dee757e6d00.png[/img]中,应当选择[img=33x25]1803dee760331fd.png[/img]和[img=33x25]1803dee767b1800.png[/img],元素之和为[img=18x18]1803dee76f6ce17.png[/img]。给出该问题的解决算法如下,空白处应填入____输入:正数数组[img=14x19]1803dee77816338.png[/img],元素个数[img=11x14]1803dee780ab3c0.png[/img]输出:选择的元素,最大不相邻元素之和创建数组[img=49x25]1803dee78908872.png[/img],[img=25x25]1803dee791533d8.png[/img]表示数组[img=49x25]1803dee79999d04.png[/img]中的最大不相邻元素之和创建数组[img=70x25]1803dee7a1c0f34.png[/img]记录选择方案[img=88x25]1803dee7a9d7046.png[/img][img=179x25]1803dee7b2c94ef.png[/img]if[img=126x25]1803dee7bb69c17.png[/img] then[img=130x25]1803dee7c3e0d95.png[/img][img=86x25]1803dee7cc17682.png[/img][img=86x25]1803dee7d4bf257.png[/img][img=72x25]1803dee7dd6730b.png[/img] endelse[img=51x25]1803dee7e5c8f09.png[/img] [img=86x25]1803dee7ee5a9f8.png[/img] [img=86x25]1803dee7f64585d.png[/img] [img=86x25]1803dee7fe9ae54.png[/img]endfor[img=82x18]1803dee806bc6b6.png[/img] doif then [img=84x25]1803dee80f88210.png[/img]endelse[img=101x25]1803dee81864d13.png[/img][img=84x25]1803dee820dcc1a.png[/img]endendreturn [img=65x25]1803dee82886a45.png[/img] A: [img=390x25]1803dee833a7746.png[/img] B: [img=390x25]1803dee83ef03f5.png[/img] C: [img=414x25]1803dee849caffa.png[/img] D: [img=390x25]1803dee856875dc.png[/img]

  • 1