ARTS completed a week
Do at least a week leetcode algorithm problem
Read and review at least one technical articles in English
At least one technical skill learning
Share ideas and think there is a technical article.
(That is, Algorithm, Review, Tip, Share short ARTS)
Algorithm
Two numbers and II - an ordered array of input
Has been given a follow ascending ordered array to find the number of two numbers such that their sum is equal to the target sum.
solution
Time complexity: O (n)
complexity of space: O (1)
thinking: Because it is ordered array, head and tail pointers may be used a method, constantly moving to the intermediatevector<int> twoSum(vector<int>& numbers, int target) { int i = 0, j = numbers.size() - 1; vector<int> vret; while(i <= j ){ if (numbers[i] + numbers[j] > target) j --; else if (numbers[i] + numbers[j] < target) i ++; else{ vret.push_back(numbers[i]); vret.push_back(numbers[j]); break; } } return vret; }
Review
How you should think about docker containers if you understand linux.
It introduces the concept of linux container and container use cgroups, namespace, chroot technology.
Tip
yum downloaded RPM package and dependent packages in two ways
By this method, the package can be downloaded to desired rpm.
Share