DFS & Pruning & status search

D - red and black The garlic factory has a rectangular house with square tiles of red and black on the ground. You stand on one of the black tiles and can only move to the adjacent black tiles. Please write a program to calculate how many black tiles you can reach. Idea: use dfs to search. At the same time, the rows and columns are no more th ...

Added by jarvis on Tue, 18 Jan 2022 16:42:12 +0200

Array structure of data structure and algorithm

Data structure and algorithm (1) array structure I Basic use of arrays Create and initialize arrays It is easy to declare, create, and initialize arrays in JavaScript, as follows: //Create and initialize arrays let daysOfWeek = new Array(); let daysOfWeek = new Array(7); let daysOfWeek = new Array('Sunday','Moday','Tuesday','Wednesday','Thu ...

Added by stvs on Tue, 18 Jan 2022 15:43:15 +0200

Sword finger Offer [Python implementation]

Sword finger Offer notes [Python description] Find in 2D array Title Description: In a two-dimensional array (each one-dimensional array has the same length), 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 a function, enter such a two-dimensional array a ...

Added by sharal on Tue, 18 Jan 2022 14:58:14 +0200

[image steganography] matching image steganography based on matlab GUI LSB [including Matlab source code phase 812]

1, Introduction 1 Introduction to LSB algorithm The full name of LSB is Least Significant Bit (LSB), which is a simple and effective data hiding technology. The basic method of LSB steganography is to replace the lowest bit of the carrier image with the secret information to be embedded. The high-order plane of the original image and the lowes ...

Added by superaktieboy on Tue, 18 Jan 2022 14:25:11 +0200

[java data structure and algorithm linked list]

I Linked list 1. Linked list definition A linked list is a recursive data structure. It is either empty (null) or a reference to a node that contains a generic element and a reference to another linked list. In this definition, a node is an abstract entity that may contain any type of data type. Its applications to nodes show its usefulne ...

Added by gvanaco on Tue, 18 Jan 2022 09:53:57 +0200

1080 MOOC final score (25 points)

subject For MOOC in Chinese Universities( http://www.icourse163.org/ )Students studying the "data structure" course who want to obtain a qualification certificate must first obtain an online programming homework score of no less than 200 points, and then obtain a total score of no less than 60 points (out of 100). The calculation for ...

Added by ggkfc on Tue, 18 Jan 2022 08:54:23 +0200

The worst case is the linear time selection algorithm

The worst case is the linear time selection algorithm Reference: [algorithm] Introduction to algorithm: https://www.bilibili.com/video/BV1Tb411M7FA?p=6 Ask questions: find the K-th largest number from an array, that is, the TOPK problem. This problem is often encountered in interviews and research. Then, how should this problem be solved? Of ...

Added by ChessclubFriend on Tue, 18 Jan 2022 01:00:08 +0200

Algorithm exercise 6 --- Blue Bridge Cup 2017 provincial competition "pressure calculation"

preface Blue Bridge Cup group B 2017 provincial competition blank filling question (C + +) 1, Title Description A batch of precious metal raw materials are neatly stacked in the high-tech laboratory of Planet X. The shape and size of each metal raw material are exactly the same, but the weight is different. Metal materials are strictl ...

Added by enormousrodent on Tue, 18 Jan 2022 00:53:06 +0200

5 questions to teach you how to solve the sliding window

preface The so-called window is a continuous closed set, which is generally represented by left and right pointers, but it will also change according to the meaning of the question, such as the following question 187. Repetitive DNA sequences All DNA consists of A series of nucleotides abbreviated as' A ',' C ',' G 'and'T', such as " ...

Added by [-_-] on Mon, 17 Jan 2022 23:53:27 +0200

Exercise 5-4 using functions to sum primes

This problem requires the realization of a simple function to judge prime numbers and a function to calculate the sum of prime numbers in a given interval by using this function. A prime number is a positive integer that can only be divided by 1 and itself. Note: 1 is not prime, 2 is prime. Function interface definition: int prime( int p ); ...

Added by Mr_Pancakes on Mon, 17 Jan 2022 23:34:32 +0200