本文介绍了数组的最长递减子序列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
向大家问好 我想找到数组的最长递减子序列 int [] arr = {5,8,4,3,2,10,9,7,5,3,12,2} 在C#中如何帮助我
hello to all i want to find longest decreasing subsequence of array int [] arr={5,8,4,3,2,10,9,7,5,3,12,2} in C# how to do this help me
推荐答案由于这是您的作业,因此我不会给您代码. 但是,有许多不同的方法可以执行此操作,从嵌套循环的Brute-Force-And-Ignorance方法开始,到为每个节点创建树都结束. Google会为您提供帮助,但我不能-我不知道您有多少经验(尽管我怀疑不多),因此不能根据您的经验推荐解决方案. 如果其他所有方法都失败了,那么虽然蛮慢,但蛮力强制和无知是一种易于实现的方法! Since this is your homework, I won''t give you code. However, there are a lot of different ways to do this, starting with the Brute-Force-And-Ignorance approach of nested loops, and ending with creating a tree for each node. Google will help you, but I can''t - I don''t know how much experience you have (although I suspect not much) and so can''t recommend a solution based on what you know how to do. If everything else fails, Brute-Force-And-Ignorance is an easy to implement approach, although somewhat slow!
更多推荐
数组的最长递减子序列
发布评论