当前位置:网站首页>Huawei 2020 school recruitment written test programming questions read this article is enough (Part 2)
Huawei 2020 school recruitment written test programming questions read this article is enough (Part 2)
2022-07-29 05:49:00 【Quantify NPC】
background
Continue with the background of the previous article , Keep looking. , First, send out another copy of the outline .

dried food ( Advanced part )
1. Advanced data structure concept , Basic operation , And advantages and disadvantages, etc
1.1 Binary search tree
Simple questions
Medium question
- ( Middle order traversal of binary trees )
- ( Impassable binary search tree )
- ( Binary search book iterator )
- ( From binary search book to bigger and tree )
1.2 Pile up
Simple questions
Medium question
- ( Sort the characters according to their frequency of occurrence )
- ( front K High frequency words )
- ( Refactoring strings )
1.3 graph theory
Simple questions
Medium question
2. Common algorithms and ideas
2.1 Sorting algorithm ( Fast 、 Insert 、 Heap sort, etc )
Simple questions
Medium question
2.2 iteration 、 The idea of recursion
Simple questions
Medium question
2.3 The idea of partition ( Such as : Two points search 、 Merge, sort, etc )
Simple questions
Medium question
2.4 search algorithm ( depth , Breadth )
Simple questions
Medium question
2.5 Greedy Algorithm
Simple questions
Medium question
2.5 Dynamic programming ( knapsack 0-1 difficulty )
Simple questions
Medium question
appendix : Blood spitting notes
Using data structures and algorithms
data structure : character string 、 Array 、 Stack 、 queue ( Including priority queues 、 deque )、 Linked list 、 Hashtable 、Set、 Binary tree . Priority queues can be used to solve the smallest and largest problems , I'm still a little dizzy about the adjustment of the heap .
Algorithm : In front of the binary tree / in / In the following order / Level traversal ; Of Graphs BFS、DFS、 Shortest path algorithm 、 Minimum spanning tree ; to flash back 、 recursive 、 Dynamic planning, etc . The basic data structure of sorting algorithm has ready-made wheels , Just understand the principle .
The focus here is on the official examination scope .
about JAVA, Focus on the characteristics of several commonly used collection classes ( Is it orderly 、 What order 、 Is repetition allowed ), In the process of solving problems, you can immediately think of which data structure a feature needs 、 Which class library .

Typical problem solving ideas summarized in the process of problem brushing ( Continuous brushing , If you have experience, please detour )
1. Sliding window
Sliding window is a double pointer problem solving idea , use left、right Left and right hands , Represents the leftmost and rightmost ends of a sliding window ( initialization left = right = 0). The left and right hands move in turn , Window size increases and decreases ( The window size can be fixed or dynamic , According to the title requirements ), The window keeps sliding to the right , Finally, the best solution of the problem can be obtained in linear time . Sometimes topics need to be supplemented by HashMap、 Array to determine the existence 、 The feasibility of .
Recommended articles : The sliding window
2. Linked list
The most basic operation of linked list : establish 、 Insert 、 Deletion is a must .
The commonly used problem-solving method is mainly using the fast and slow pointer ( Only the lookup operation is involved )、 Add auxiliary head node ( It involves adding, deleting and modifying ), On this basis, how to judge whether the linked list has links and entry points 、 Intermediate nodes 、 Reciprocal K It is recommended to master the skills of solving problems . List questions must be drawn on white paper , Draw and write .
Recommended articles : Linked list
3. Pictures
Recommend programmer Xiaohui 2019 Several posts about pictures in , It's very easy to understand 
4. Binary tree
Binary tree feels no skill , It's good to have solid basic skills . The focus is on the front / in / In the following order / Sequence traversal ,LeetCode There will be some variants based on these , such as Z Font printing , Foreword and middle order , Recover binary tree from middle order and post order traversal , The finger of the sword offer And Xiaohui have typical explanations .
5. Retrospective method
Backtracking algorithm is a search attempt process similar to enumeration , According to the depth first search strategy , Starting from the root node, we explore the solution space tree , When a node is explored , We should first judge whether the node contains the solution of the problem , If you include , We will continue to explore from this node ; If the node does not contain the solution of the problem , Just “ to flash back ” return , That is, go back and choose again , Try another path .
If we use the backtracking method to find all the solutions of the problem , Go back to the root , And all feasible subtrees of the root node have to be searched all over before the end . And if we use the backtracking method to find any solution , As long as you find a solution to the problem, you can end it .
Adapt to the question type : Complete permutation and combination
Templates : I saw LeetCode There is a good template in , To be added .
6. Dynamic planning
Dynamic planning means that the next state can be based on the previous state , Or a reasoning process obtained from previous states . You can see the detailed dynamic planning —— Zou Bo talked about Dynamic Planning , It talks about the path 、 COINS 、 The longest subsequence .
Although I have been tested many times , I made seven or eight strokes , It is always dizzy to reason the state transition equation by yourself –#, Fortunately DP The problem that can be solved , There are other wheels that can be solved .
7. Bit operation
Bit operation is very basic , Typical bit operation skills and Applications , But they are seldom used in daily work , Wen guxia : An operation
边栏推荐
猜你喜欢

Flink connector Oracle CDC 实时同步数据到MySQL(Oracle19c)

The LAAS protocol of defi 2.0 is the key to revitalizing the development of defi track

Day14: upload labs customs clearance tutorial

Fantom (FTM) prices will soar by 20% in the next few days

Extreme deflation and perpetual motion machine model will promote the outbreak of platofarm

性能对比|FASS iSCSI vs NVMe/TCP

Masscan tutorial

IDEA使用JDBC连接MySQL数据库个人详细教程

xSAN高可用—XDFS与SAN融合焕发新生命力

Changed crying, and finally solved cannot read properties of undefined (reading 'parsecomponent')
随机推荐
Thinkphp6管道模式Pipeline使用
Starfish OS: create a new paradigm of the meta universe with reality as the link
sql-server 数据表的简单操作
Related knowledge of elastic box
Seay source code audit system
Training log 4 of the project "construction of Shandong University mobile Internet development technology teaching website"
The LAAS protocol of defi 2.0 is the key to revitalizing the development of defi track
熊市下PLATO如何通过Elephant Swap,获得溢价收益?
“山东大学移动互联网开发技术教学网站建设”项目实训日志五
运动健康深入人心,MOVE PROTOCOL引领品质生活
Mobile terminal -flex item attribute
The completely decentralized programming mode does not need servers or IP, just like a aimless network extending everywhere
Gluster集群管理小分析
农村品牌建设给年轻人的一些机会
Starfish OS:以现实为纽带,打造元宇宙新范式
Build msys2 environment with win10
Character type conversion
大部分PHP程序员,都搞不懂如何安全代码部署
浅谈分布式全闪存储自动化测试平台设计
SQL修复重复数据