大浪淘沙

以平常心对股市沉浮, 不悔不怕
博文
Knowledgebase:ListNodetraverseusingwhileloopwithnode.next!=nulldeletenode.next=node.next.nexttraversenode=node.nextpublicListNodedeleteDuplicates(ListNodehead){
if(head==null||head.next==null)returnhead;
ListNoderes=head;
while(res.next!=null){
if(res.val==res.next.val)
res.next=res.next.next;
else
res=res.next;
}
returnhead;
}[阅读全文]
阅读 ()评论 (0)
(2019-12-05 01:39:25)
Knowledgebase:1.arrayfromback2<9addandreturn3=9changethevalueto0andnextloopplusone4allvalueare0createanewarraypublicint[]plusOne(int[]digits){
if(digits==null||digits.length==0)returndigits;
intindex=digits.length-1;

while(index>=0){
if(digits[index]<9){
digits[index]+=1;
returndigits;
}
else
digits[index]=0;
index--;

}
int[]res=ne...[阅读全文]
阅读 ()评论 (0)
(2019-12-05 01:00:03)
69.Sqrt(x)Knowledgepoint:1.binarysearch:low,highmidwhile(low<=high)mid=(high-low)/2+low2Mathcalculation:longmid3sqrt:mid*mid<highpublicintmySqrt(intx){
if(x<=0)return0;
intlow=1;
inthigh=x;
while(low<=high){
longmid=(high-low)/2+low;
if(mid*mid==x)
return(int)mid;
elseif(mid*mid<x)
low=(int)mid+1;
elsehigh=(int)mid-1;


}
if(hi...[阅读全文]
阅读 ()评论 (0)
(2019-12-05 00:28:49)
leetcode2.Add2numbersknowledgepoint:1.listNodechecknulllistNodedummynodetraverseusingnode=node.next2.Addnumber:res=sum%10carry=sum/10publicListNodeaddTwoNumbers(ListNodel1,ListNodel2){
if(l1==null)returnl2;
if(l2==null)returnl1;
ListNodedummy=newListNode(0);
ListNoderes=dummy;
intsum=0;
while(l1!=null||l2!=null){
if(l1!=null){
sum+=l1.val;
l1=l1.next;
}
...[阅读全文]
阅读 ()评论 (0)
(2019-12-04 23:57:32)
Leetcode12sum:HashMaptorecordKeyvaluepair,get(target-nums[i])orputthevalueKnowledge:MaptogetandputandcontainsKeyArrayforloopspace:o(1)time:o(n)publicint[]twoSum(int[]nums,inttarget){
if(nums==null||nums.length==0)returnnewint[]{-1,-1};
HashMap<Integer,Integer>map=newHashMap<>();
for(inti=0;i<nums.length;i++){
if(map.containsKey(target-nums[i]))
returnnewint[]{map...[阅读全文]
阅读 ()评论 (0)
(2019-12-04 23:38:21)

leetcode753pointer:indexisthemainOneindex0pointto0index2pointto2publicvoidsortColors(int[]nums){if(nums==null||nums.length==0)return;intleft=0;intright=nums.length-1;intindex=0;while(index<=right){if(nums[index]==0){swap(nums,index++,left++);}elseif(nums[index]==1){index++;}else{swap(nums,index,right--);}}}publicvoidswap(int[]nums,inti,intj){inttemp=nums[i];nums[i]=nums[j];nums[j]=temp;}[阅读全文]
阅读 ()评论 (0)
(2019-11-23 21:15:25)
RSIdivergencefortrendreversalwiderswingandclosetooverboghtandoversoldpullbackistheperfect:stoploss50emaabovepivotabove50emaagressivetrigger:widedivergencebest1hourpullback14cross50pivot[阅读全文]
阅读 ()评论 (0)
(2019-11-23 15:01:50)
Timeconflence:
monthly,weeklyanddailycandlestick:longwickandengulfingtrendlineandsupportandresistence50Ematrendlinebreakwithsupportandresistence:greatentrypointbelow50Ema:downtrendsidewaytrending:supportandresistenceFibronaci:0.618pullbackbetween0.5-0.618Fundermental:readthenewseverydaytoavoidviolabilityMomentomloss:smallercandle-->longwick-->reverseengulfingwideswingdoubletopanddoublebo...[阅读全文]
阅读 ()评论 (0)
(2019-11-22 19:00:06)
Priceaction:candlestickbreakthetrendlinecandlestickbreakthetrendlineorshoulderlineentrybelowthecandlelowstopatthecandlemovetoabovesupportlinemovetoaboveswingtopoversoldstoplosstighterTimeframe:weeklycandlebreakDailybreakthetrendConfirmwith4hour[阅读全文]
阅读 ()评论 (0)
(2019-11-22 10:21:07)
spyreachthetop,MACDreachfork,EmacrosswaitingStrategy,waitingforbuyattherightpointMACDcrossagainXLP,XLU401KRothIRAApplebuyat218XLEcouldgavemoreopportunitywaitingforsmalloilcompanytodropAshrmacdcrossdailydownashrmacdmonthup-->holdXLUholdmacddailycross[阅读全文]
阅读 ()评论 (0)
[<<]
[6]
[7]
[8]
[9]
[首页]