Java handwriting algorithm interview questions
java written test handwriting algorithm interview questions with answers
1. Count the number of words in an English article.
public class WordCounting {
public static void main(String[] args) {
try(FileReader fr = new FileReader("a.txt")) {
int counter = 0;
boolean state = false;
int currentChar;
while((currentChar= fr.read()) != -1) {
if(cur ...
Added by mabwi on Thu, 16 Dec 2021 18:52:13 +0200
Zuoshen promotion 6: violent recursion to dynamic programming
content
Describe the relationship between violent recursion and dynamic programming
Memory search cache
Dynamic programming can be improved by violent recursion to solve the routine of dynamic programming
Common attempt models
Principles of design trial process
This section is the general outline of violence recursion to dynamic programmi ...
Added by evmace on Wed, 15 Dec 2021 02:17:58 +0200
The fourth day of nine day training
First question
The integer array nums is arranged in ascending order, and the values in the array are different from each other.
Before passing to the function, Num rotates on a previously unknown subscript k (0 < = k < num.length), making the array [num [k], Num [K + 1],..., Num [n-1], Num [0], Num [1],..., Num [k-1]] (subscripts count ...
Added by vcv on Sun, 12 Dec 2021 14:44:56 +0200
Algorithm after class exercises (divide and conquer algorithm)
1. Title:
Let X[0:n-1] and Y[0:n-1] be two arrays, and each array contains n ordered numbers. Try to design an O(logn) time divide and conquer algorithm to find the median of 2n numbers of X and y.
Algorithm idea:
In fact, we don't need to really merge the two arrays. We just need to find out where the median is.
The initial idea is to writ ...
Added by stylefrog on Sun, 12 Dec 2021 12:16:12 +0200
[problem solving report] series of lecture 100 on zero basis of algorithm (Lecture 2)
☘ preface ☘
Today is the second day of the zero basis clock out of the algorithm. Today's problem is deadly -. -. Link on: Series of lecture 100 on the basis of zero algorithm (Lecture 2)
🧑🏻 About the author: a young man who changed from industrial design to embedded ✨ Contact: 2201891280(QQ) ⏳ Approximate reading time of the full te ...
Added by cloudnyn3 on Sat, 11 Dec 2021 15:57:10 +0200
Educational Codeforces Round 118 (Rated for Div. 2)
A. Long Comparison
Title: Portal
Question meaning: give two numbers and the number of zeros after these two numbers respectively. Who is bigger and who is smaller after these two combined numbers, output '>', '<' or '=';
Solution idea: direct violent simulation, first look at the number of digits after combination, and then cycle simul ...
Added by MitchEvans on Thu, 02 Dec 2021 22:44:33 +0200
Programming language producer consumer model and simple implementation of Golang
Programming language producer consumer model and simple implementation of Golang
Introduction: This paper introduces the producer consumer model and the demo of the simple implementation of go.
1, Producer consumer Model
Producer consumer model: a module (function, etc.) is responsible for generating data, which is processed by another modul ...
Added by homerjsimpson on Thu, 25 Nov 2021 05:34:32 +0200
Programming language Python Jieba Thesaurus
Programming language Python Jieba Thesaurus
jieba database is an excellent third-party database for Chinese word segmentation. Chinese text needs to obtain a single word through word segmentation
jieba library installation
Run the cmd window as an administrator and enter the command: pip install jieba
jieba library function introductio ...
Added by ddoc on Thu, 25 Nov 2021 03:36:28 +0200
leetcode notes
1.Hash related
When using HashMap, why can you find the corresponding value according to map.get(key) with time complexity O(1)?
Because the physical structure uses a hash table
Calculate the array position where the Entry should be stored according to a special algorithm. If the positions are the same, there are various methods to solve the ...
Added by deejay1111 on Wed, 24 Nov 2021 18:54:55 +0200
Pressure DP question sheet
State compression DP
skill
Find how many are contained in the binary representation of a number
t
r
u
e
true
true:
int table[16] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
int po ...
Added by hastishah on Fri, 19 Nov 2021 09:27:52 +0200