Where to go net 2014 written test algorithm summary
- Write a function that transforms the relative path to an absolute path, for example:/home/abs/. /temp/new/. /, the output path is:/home/temp.
- A 10*10 matrix (can be understood as a chessboard), at any time to generate a set of data to fill the matrix, the number of any one position in addition to 4 for calculation, by the remainder coloring, the remainder of 0 coloring to red,1 for the blue,2 for green,3 Black, can be understood as the generation of 4 colors of the pieces into the chessboard, If there is a case of the same color five-star alignment (rule pass Gobang), find any group, output 5 pieces of the position subscript value.
3. There are two files Context.txt and words.conf, please try to merge them into a piece of text and print them out.
The contents of these two files are as follows:
Context.txt
"Not everyone needs $ (qunar) their own food, $ (flight.1) Everyone needs to do their own $ (flight.2), we say someone invented the $ (hotel), using someone else invented math ... We have been in $ (Tuan) others ' results. Using the human experience and knowledge $ (TRAVEL.1) to proceed, is a $ (TRAVEL.2) thing "
Word.conf
Flight= is not: clothes
Qunar= Planting
Hotel= language
tuan= use
Travel= invention: It's amazing.
4. There are 100,000 random positive integers in a file, and a new piece of data can be combined according to the following rules:
A If the current number can be divisible by 3, then it is combined with all the numbers in the file (including itself) 22 to form a set of numbers instead of their position.
B If it cannot be divisible by 3, it only needs to multiply by two, generating a number instead of its own position.
For example: [3,7,6] will assemble [6,10,9,14,9,13,12]
Again such as: [5,12,9,6,2] will be combined out [10,17,24,21,18,14,14,21,18,15,11,11,18,15,12,8,4]
Write a program to find and print out the minimum first 200 digits of the new data. Consider optimizing the complexity of your algorithm.
5. Known alphabetic sequence "D, G, E, C, F, B, O, a", implement a function for the input of a set of strings input[] = {"Bed", "dog", "Dear", "eye"}, sorted alphabetically and printed.
The output order for this example is: Dear, dog, eye, bed.
6.10,000 Beijing single men and women have submitted basic information to you, including: Name, gender, age, constellation, and write a program to try to find their most matched pair.
Where to go net 2014 questions