Greedy algorithm problem solving

A. Base station installation Description Once upon a time, there was an endless beach. Behind the beach was land and in front of it was a vast sea. There are many small islands in the sea. Now, some base stations (anywhere on the beach) need to be installed on the beach, so that the residents on the island can talk with their mobile phones. T ...

Posted by seularts on Sun, 08 May 2022 10:19:18 +0300

A necessary skill (algorithm) for contemporary programmers: recursive explanation

preface Recursion is a very important algorithm idea. You need to master it whether you are front-end development or back-end development. In daily work, recursive algorithms are needed to count the size of folders, parse xml files and so on. It's too basic and important, which is why interviewers often ask us to write recursive algorithms. In ...

Posted by NoMansLand on Sun, 08 May 2022 06:34:17 +0300

Knowledge map tracing 1.1 -- starting from NER

Overview of this article: recurrence of knowledge- KG open source project set Medium BERT-NER-pytorch Some learning records after the project are of reference significance to Xiaobai, who is also a newcomer. Data: about the introduction of transformer in BERT model, what must be shared is Animation of Jay Alammar , why didn't I see such a good ...

Posted by MartiniMan on Sun, 08 May 2022 05:09:16 +0300

2018 Blue Bridge Cup group B national competition

2013 Blue Bridge Cup group B national competition 2014 Blue Bridge Cup group B national competition 2015 Blue Bridge Cup group B national competition 2016 Blue Bridge Cup group B national competition 2017 Blue Bridge Cup group B national competition (1) Triangle area It is known that the coordinates of the three vertices of the triangl ...

Posted by jesse_james on Sun, 08 May 2022 04:38:20 +0300

[backtracking algorithm] facebook interview question - bracket generation

catalogue Title Description Backtracking solution Title Description Title address: https://leetcode-cn.com/problems/generate-parentheses/ Given that n represents the logarithm of the generated parentheses, please write a function so that it can generate all possible and effective parenthesis combinations. For example, given n = 3, the gen ...

Posted by sundawg on Sat, 07 May 2022 22:48:58 +0300

Exercise 1 - recursion, etc

1000 Problem A Time limit: 40/20 MS(Java/Others) | memory limit: 65536/32768 KB(Java/Others) Submits : 110 | Solved : 24 Title Description Given a set of unordered values, the size of the values is between 1 and 1 million, and the number of values is between 100000 and 500000. Now you need to find the 5th to 10th smallest integer. Input re ...

Posted by Ghettobusta on Sat, 07 May 2022 15:47:01 +0300

PAT_ Class A_ 1053 Path of Equal Weight

Main idea of the title: Given a tree and the weight of each node, find the path from all root nodes to leaf nodes, so that the sum of the weight on each path is equal to the given constant S. if there are multiple paths, output according to the non increasing sequence of paths Algorithm idea: Considering the traversal of the tree, since it is n ...

Posted by laurton on Sat, 07 May 2022 14:01:39 +0300

The most basic front-end algorithm

Bubble Sort Instructions for bubble sorting: As one of the simplest sorting algorithms, bubble sorting gives me the same feeling as that of Abandon in the word book. It comes first on the first page every time, so I am most familiar with... Another optimization algorithm for bubble sorting is to set up a flag. When there is no exchange of elem ...

Posted by naitsir on Sat, 07 May 2022 11:08:44 +0300

[Backtracking interview questions] facebook interview questions - letter combinations of phone numbers (two solutions)

content Topic description Backtracking solution Solve using queues Topic description Title address: https://leetcode-cn.com/problems/letter-combinations-of-a-phone-number/ Given a string containing only the numbers 2-9, return all letter combinations it can represent. The mapping of numbers to letters is given as follows (same as phone k ...

Posted by johnpaine on Sat, 07 May 2022 10:12:49 +0300

Optimal Binary Retrieval Tree

Optimal Binary Retrieval Tree Definition Dataset S is an ascending set, and for the optimal binary search tree itself and all its subtrees, the left child < root < right child is satisfied. Number of comparisons Suppose you look for data x in the binary tree, compare it with the root node, go into the left subtree search smaller than t ...

Posted by jestercobblepot on Wed, 04 May 2022 19:00:08 +0300