Knapsack model of dynamic programming and its extended application

preface For the original knapsack problem and its optimization, please refer to this blog knapsack problem Initialization of knapsack problem There are three general problems Corresponding initialization method For volume up to j, f [ 0 ...

Posted by BobLennon on Mon, 21 Feb 2022 07:36:45 +0100

Some exercises of dynamic programming

1. Change subject class Solution { public int coinChange(int[] coins, int amount) { int n = coins.length; int[] arr = new int[amount + 1];// 0..amount // Define initial conditions arr[0] = 0; for(int i = 1; i <= amount; i++) { // Find arr[i] arr[i] = Integer.MAX_VALUE; ...

Posted by nagrgk on Mon, 21 Feb 2022 07:31:36 +0100

High precision algorithm (children can understand = =)

High precision algorithm Here comes the question time (0v0!): Question (1): What is a high-precision algorithm? Why do we need high-precision algorithms? What can high-precision algorithms be used for? Question (2): How to store a large number? Question (3): How can you add them up? subtract? Multiply? What about division? - ...

Posted by SerpentSword on Mon, 21 Feb 2022 06:11:41 +0100

[force buckle question type summary and template] sword finger offer 1 - array and string

Question type summary subjectsummarypracticekey wordFind in 2D arrayIn an n * m two-dimensional array, each row is sorted in ascending order from left to right, and each column is sorted in ascending order from top to bottom. Please complete an efficient function, input such a two-dimensional array and an integer, and judge whether the arr ...

Posted by cloudnyn3 on Mon, 21 Feb 2022 03:59:30 +0100

Daily algorithm & interview questions, 28 days of special training in large factories - the 15th day (string)

This article comes from the special training column of algorithm interview questions. There are a large number of professional algorithm questions here, such as 21 days of dynamic planning, 28 days of special training in large factories, etc Welcome to study together. Link: Portal Reading guide Fat friends, in order to better help n ...

Posted by dey.souvik007 on Mon, 21 Feb 2022 01:31:38 +0100

LeetCode algorithm problem 117 solution + joint search set

1, Topic retelling leetCode algorithm Title: https://leetcode-cn.com/problems/H6lPxb/ Briefly described as: 1. Provides an array of strings. There are letter ectopic words between the string elements of the array. For example, "aaabb" and "baaab"; That is, the letters that make up the string are the same, and the letters ap ...

Posted by kennethl on Sun, 20 Feb 2022 20:15:38 +0100

Algorithm -- ten common sorting algorithms (implemented in python)

1, Bubble sorting Algorithm idea: When sorting the i (i = 1, 2,...) pass, start from the first element of the first n - i + 1 element in the sequence, and compare the two adjacent elements. If the former is greater than the latter, the two exchange positions, otherwise they will not exchange. Bubble sorting method is to make the element ...

Posted by john87423 on Sun, 20 Feb 2022 19:25:05 +0100

Thinking Guide for learning algorithms and brushing questions

First of all, what we're talking about here are ordinary data structures. I'm not engaged in algorithm competition. Noriko was born. I can only solve conventional problems. In addition, the following is a summary of my personal experience. No algorithm book will write these things, so please try to understand my perspective and don't dwell on d ...

Posted by toovey on Sun, 20 Feb 2022 19:25:49 +0100

Leetcode's notes -- the combinatorial problem of backtracking algorithm

Catalogue of series articles I Array type problem solving method 1: dichotomy II Array type problem solving method 2: Double finger needle method III Array type problem solving method 3: sliding window IV Array type problem solving method 4: simulation V The basic operation and classic topics of the linked list Vi Classic title of hash tab ...

Posted by Jack McSlay on Sun, 20 Feb 2022 18:27:37 +0100

Summary of Huawei machine test questions

Python wechat ordering applet course video https://edu.csdn.net/course/detail/36074 Python actual combat quantitative transaction financial management system https://edu.csdn.net/course/detail/35475 Generally speaking, the difficulty of the questions in the recent year is simple and medium. The questions are divided into five categories: ch ...

Posted by weyes1 on Sun, 20 Feb 2022 17:05:55 +0100