![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法分析与设计相关题目
Drscq
STRIVE FOR MY DREAM
展开
-
算法分析(time and storage complexity)
1.1 算法的时间复杂度分析e.g. 1.4 This example is use do to illustrate the average, worst-case and best case cost for running an algorithmdescription of the example: find the element you want in an array using sequential selectin method.原创 2021-12-11 11:27:59 · 179 阅读 · 0 评论 -
find the element you want
The outputs:Input the length of array: 12 1 3 3 8 7 2 2 7 2 5 4 1scan and identify whether 1 exists or notThere is an element 1 in the arrayThe corresponding codes://step_1 generate a random array with random values// step_2 suppose原创 2021-12-11 11:26:22 · 491 阅读 · 0 评论 -
Material for Preparing Final Exam
Material for Preparing Final ExamChapter_8 Dynamic ProgrammingMaterial for Preparing Final Exam求解袋鼠过河问题(p226)求解数字和为sum的方法数问题p228求解分饼干问题p232求解堆砖块问题p234原创 2021-10-30 21:11:22 · 81 阅读 · 2 评论 -
Find a specific number in your link list
The length of the sequence: 7The index: 0The length of the sequence: 20The index: 1The corresponding codes://find a specific number in a link sequence#include <iostream>#include <iomanip>#include <ctime>#include <cstdlib.原创 2021-12-01 22:47:25 · 588 阅读 · 0 评论 -
Generate a link list by recursive methods
The outputs: 2 8 5 1 10the corresponding codes:\#include <iostream>#include <iomanip>using namespace std;struct LNode{ int value; LNode *next;};LNode *generate_Link(int n);void disp_Link(LNode *head);int main(){原创 2021-12-01 22:45:36 · 70 阅读 · 0 评论