2021-9-19 707. Design linked list (single linked list + double linked list)
Note:
Title: Design the implementation of linked list. You can choose to use single linked list or double linked list. A node in a single linked list should have two attributes: val and next. val is the value of the current node, and next is the pointer / reference to the next node. If you want to use a two-way linked list, you also need an at ...
Posted by yrrahxob on Sun, 19 Sep 2021 16:02:36 -0700
[data structure and algorithm] Chapter 5: linear table (sequence table, linked list, stack, queue, symbol table)
5. Linear table
Linear table is the most basic, simplest and most commonly used data structure. A linear table is a finite sequence of n data elements with the same characteristics
Precursor element: if element A is in front of element B, A is called the precursor element of B
Successor element: if element B is after element a, it is calle ...
Posted by emediastudios on Sun, 19 Sep 2021 14:01:16 -0700
Fundamentals of binary search algorithm
In binary search, the definition of the search interval of the target element is very important, and the definitions of different intervals are written differently. Because the search interval is iterative, it is very important to determine the search range, mainly the opening and closing of the left and right intervals. The opening and closing ...
Posted by audiodef on Sun, 19 Sep 2021 11:05:30 -0700
[image registration] image registration based on Powell + ant colony algorithm matlab source code
1 Introduction
1 origin and development of ant colony algorithm (ACA) In the process of studying the new algorithm, Marco Dorigo and others found that when ant colony is looking for food, they can exchange foraging information by secreting a biological hormone called pheromone, so they can quickly find the target. Therefore, in their doctoral ...
Posted by mnick on Sun, 19 Sep 2021 11:04:34 -0700
1057 stock trading IV (state machine model)
1. Problem Description:
Given an array of length N, the ith number in the array represents the price of a given stock on day i. Design an algorithm to calculate the maximum profit you can make. You can complete up to k transactions. Note: you cannot participate in multiple transactions at the same time (you must sell the previous shares before ...
Posted by Undead_Zeus on Sun, 19 Sep 2021 10:44:29 -0700
✨✨✨ [C language] take you to brush questions in the shortest time (with problem-solving ideas and specific codes) and constantly update them ✨✨✨
🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷
🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷🐷
💚 BC23. Time conversion
Description:
Given number of seconds seconds (0< seconds < 100,000,000),Convert seconds into hours, minutes, and seconds
Enter Description:
One line, including an integer, that is, the given number of sec ...
Posted by shonuff on Sun, 19 Sep 2021 07:22:02 -0700
[difficult] best stock trading opportunity
problem
Given an array arr of length N, its ith element is the price of a given stock on day i. Design an algorithm to calculate the maximum profit you can make. You can complete up to k transactions. You cannot participate in multiple transactions at the same time (you must sell the previous shares before buying again).
[dynamic planning ide ...
Posted by v0id on Sun, 19 Sep 2021 01:45:36 -0700
[prediction model] optimize BP neural network based on longicorn whisker algorithm to realize data prediction matlab source code
1 Introduction to algorithm
1.1 principle of BP neural network algorithm affected by relevant indexes
As shown in Figure 1, when training BP using MATLAB's newff function, it can be seen that most cases are three-layer neural networks (i.e. input layer, hidden layer and output layer). Here to help understand the principle of neural network: 1 ...
Posted by tzzoug on Sat, 18 Sep 2021 19:52:24 -0700
7-1 matrix chain multiplication problem (20 points) (thinking + detailed explanation + topic analysis) dynamic programming practice
1: Title:
The multiplication of matrix is defined as follows: let A be m × The matrix of P, B is p × N, then the product of A and B is m × The matrix of n is written as C=AB, where the element C in row i and column j of matrix C ij It can be expressed as: c ij =Σ k=1 p a ik ×b kj =a i1 b 1j +a i2 b 2j +⋯+a ...
Posted by eaglelegend on Sat, 18 Sep 2021 15:23:59 -0700
LeetCode 005 string series
String (3)
Hello, everyone! I'm Xiao Sheng! I was busy learning java back-end technology, delayed the update of algorithm topics, and was ashamed to set up a weekly brushing plan to break through. Now I'm on the road of brushing again, keep it up! Go on!
String (3) Series of questions as follows
Subsequence (392)
392. Judgment Subseq ...
Posted by brainstorm on Sat, 18 Sep 2021 11:41:23 -0700