TheCAS-PEALfacedatabasehasbeenconstructedunderthesponsorsofNationalHi-TechProgramandISVISIONbytheFaceRecognitionGroupofJDL,ICT,CAS.ThegoalstocreatethePEALfacedatabaseinclude:providingtheworldwideresearchersofFRcommunityalarge-scaleChinesefacedatabasefortrainingandevaluatingtheiralgorithms;facilitatingthedevelopmentofFRbyprovidinglarge-scalefaceimageswithdifferentsourcesofvariations,especiallyPose,Expression,Accessories,andLighting(PEAL);advancingthestate-of-the-artfacerecognitiontechnologiesaimingatpracticalapplicationsespeciallyfortheoriental.Currently,theCAS-PEALfacedatabasecontains99,594imagesof1040individuals(595malesand445females)withvaryingPose,Expression,Accessory,andLighting(PEAL).Foreachsubject,9camerasspacedequallyinahorizontalsemicircularshelfaresetuptosimultaneouslycaptureimagesacrossdifferentposesinoneshot.Eachsubjectisalsoaskedtolookupanddowntocapture18imagesinanothertwoshots.Wealsoconsidered5kindsofexpressions,6kindsaccessories(3glasses,and3caps),and15lightingdirections.Thisfacedatabaseisnowpartlymadeavailable(asubsetnamedbyCAS-PEAL-R1,contain30,900imagesof1040subjects)forresearchpurposeonlyonacase-by-casebasisonly.JDLisservingasthetechnicalagentfordistributionofthedatabaseandreservesthecopyrightofalltheimagesinthedatabase.
2021/7/13 14:10:25 37B 中国人脸 数据集  dataset deeplearning
1
Beforetherewerecomputers,therewerealgorithms.Butnowthattherearecomputers,thereareevenmorealgorithms,andalgorithmslieattheheartofcomputing.Thisbookprovidesacomprehensiveintroductiontothemodernstudyofcomputeralgorithms.Itpresentsmanyalgorithmsandcoverstheminconsiderabledepth,yetmakestheirdesignandanalysisaccessibletoalllevelsofreaders.Wehavetriedtokeepexplanationselementarywithoutsacrificingdepthofcoverageormathematicalrigor.Eachchapterpresentsanalgorithm,adesigntechnique,anapplicationarea,orarelatedtopic.AlgorithmsaredescribedinEnglishandinapseudocodedesignedtobereadablebyanyonewhohasdonealittleprogra妹妹ing.Thebookcontains244figures—manywithmultipleparts—illustratinghowthealgorithmswork.Sinceweemphasizeefficiencyasadesigncriterion,weincludecarefulanalysesoftherunningtimesofallouralgorithms.Thetextisintendedprimarilyforuseinundergraduateorgraduatecoursesinalgorithmsordatastructures.Becauseitdiscussesengineeringissuesinalgorithmdesign,aswellasmathematicalaspects,itisequallywellsuitedforself-studybytechnicalprofessionals.Inthis,thethirdedition,wehaveonceagainupdatedtheentirebook.Thechangescoverabroadspectrum,includingnewchapters,revisedpseudocode,andamoreactivewritingstyle.
2015/3/19 14:10:12 5.87MB Algorithms C.L.R.S
1
PracticalStatisticsforDataScientists50EssentialConcepts英文无水印转化版pdfpdf一切页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开本资源转载自网络,如有侵权,请联系上传者或csdn删除查看此书详细信息请在美国亚马逊官网搜索此书PracticalstatisticsfordatascientistsbypeterbruceandandrewbruceCopyright@2017PeterBruceandAndrewBruce.AllrightsreservedPrintedintheunitedstatesofamericaPublishedbyo'reillymedia,InC.1005GravensteinHighwayNorth,Sebastopol,Ca95472O'Reillybooksmaybepurchasedforeducational,business,orsalespromotionaluse.onlineeditionsarealsoavailableformosttitles(http:/oreilly.com/safari)Formoreinformation,contactourcorporate/institutionalsalesdepartment:800998-9938orcorporateoreillycom■editor:ShannoncuttProductioneditor.KristenbrownCopyeditor:RachelmonaghanaProofreadereliahusussmanaIndexerEllenTroutman-ZaigaInteriorDesigner:DavidFutatoCoverDesigner:KarenMontgomeryllustrator.rebeccademarestaMay2017:FirstEditionRevisionhistoryfortheFirstedition2017-05-09FirstreleaseSeehttp://oreilly.com/catalog/errata.csp?isbn=9781491952962forreleasedetailsTheoreillylogoisaregisteredtrademarkofo'reillymedia,Inc.PracticalStatisticsforDataScientists,thecoverimage,andrelatedtradedressaretrademarksofo'ReillyMedia,IncWhilethepublisherandtheauthorshaveusedgoodfaitheffortstoensurethattheinformationandinstructionscontainedinthisworkareaccurate,thepublisherandtheauthorsdisclaimallresponsibilityforerrorsoromissions,includingwithoutlimitationresponsibilityfordamagesresultingfromtheuseoforrelianceonthiswork.Useoftheinformationandinstructionscontainedinthisworkisatyourownrisk.Ifanycodesamplesorothertechnologythisworkcontainsordescribesissubjecttoopensourcelicensesortheintellectualpropertyrightsofothers,itisyourresponsibilitytoensurethatyourusethereofcomplieswithsuchlicensesand/orrights978-1-491-95296-2DedicationWewouldliketodedicatethisbooktothememoriesofourparentsVictorgBruceandNancyC.bruce,whocultivatedapassionformathandscienceandtoourearlymentorsJohnW.TukeyandJulianSimon,andourlifelongfriendGeoffWatson,whohelpedinspireustopursueacareerinstatisticsPrefaceThisbookisaimedatthedatascientistwithsomefamiliaritywiththerprogramminglanguage,andwithsomeprior(perhapsspottyorephemeral)exposuretostatistics.Bothofuscametotheworldofdatasciencefromtheworldofstatistics,sowehavesomeappreciationofthecontributionthatstatisticscanmaketotheartofdatascience.atthesametimewearewellawareofthelimitationsoftraditionalstatisticsinstruction:statisticsasadisciplineisacenturyandahalfoldandmoststatisticstextbooksandcoursesareladenwiththemomentumandinertiaofanoceanlinerTwogoalsunderliethisbookTolayout,indigestible,navigable,andeasilyreferencedform,keyconceptsfromstatisticsthatarerelevanttodatascienceToexplainwhichconceptsareimportantandusefulfromadatascienceperspective,whicharelessso,andwhyWhattoExpectKEYTERMSDatascienceisafusionofmultipledisciplines,inchidingstatistics,computerscience,informationtechnology,anddomain-specificfields.Asaresult,severaldifferenttermscouldbeusedtoreferenceaivenconcept.KeytermsandtheirsynonymswillbehighlightedthroughoutthebooknasidebarsuchasConventionsusedinThisbookThefollowingtypographicalconventionsareusedinthisbookItalicIndicatesnewtermsURls.emailaddressesfilenamesandfileextensionsConstantwidthUsedforprogramlistings,aswellaswithinparagraphstorefertoprogramelementssuchasvariableorfunctionnames,databases,datatypes,environmentvariables,statements,andkeywordsConstantwidthboldShowscommandsorothertextthatshouldbetypedliterallybytheuserConstantwidthitalicShowstextthatshouldbereplacedwithuser-suppliedvaluesorbyvaluesdeterminedbycontextTIPThiselementsignifiesatiporsuggestionNOTEThiselementsignifiesageneralnoteWARNINGThiselementindicatesawarningorcautionUsingCodeExamplesSupplementalmaterial(codeexamples,exercises,etc.isavailablefordownloadathttps://github.com/andrewgbruce/statistics-for-data-scientistsThisbookisheretohelpyougetyourjobdone.Ingeneral,ifexamplecodeisofferedwiththisbook,youmayuseitinyourprogramsanddocumentation.youdonotneedtocontactusforpermissionunlessyou'rereproducingasignificantportionofthecode.Forexample,writingaprogramthatusesseveralchunksofcodefromthisbookdoesnotrequirepermission.SellingordistributingaCD-ROMofexamplesfromOReillybooksdoesrequirepermission.answeringaquestionbycitingthisbookandquotingexamplecodedoesnotrequirepermission.Incorporatingasignificantamountofexamplecodefromthisbookintoyourproduct'sdocumentationdoesrequirepermissionWeappreciate,butdonotrequire,attribution.Anattributionusuallyincludesthetitle,author,publisher,andisBN.Forexample:PracticalStatisticsfordataScientistsbyPeterBruceandAndrewBruce(o'Reilly).Copyright2017PeterBruceandandrewbruce.978-1-491-95296-2Ifyoufeelyouruseofcodeexamplesfallsoutsidefairuseorthepermissiongivenabove,feelfreetocontactusatpermissions(@oreilly.comSafari(BooksonlineNOTESafaribooksOnlineisanon-demanddigitallibrarythatdeliversexpertcontentinbothbookandvideoformfromtheworldsleadingauthorsintechnologyandbusinessTechnologyprofessionals,softwaredevelopers,webdesigners,andbusinessandcreativeprofessionalsuseSafariBooksOnlineastheirprimaryresourceforresearch,problemsolving,learning,andcertificationtrainingSafariBooksOnlineoffersarangeofplansandpricingforenterprise,government,education,andindividualsMembershaveaccesstothousandsofbooks,trainingvideos,andprepublicationmanuscriptsinonefullysearchabledatabasefrompublisherslikeO'ReillyMedia,PrenticeHallProfessional,Addison-WesleyProfessional,MicrosoftPress,Sams,Que,PeachpitPress,FocalPress,CiscoPreSs,JohnWileysonsSyngress,MorganKaufmann,IBMRedbooks,Packt,AdobePress,FTPress,press,Manning,Newriders,McGraw-Hill,Jonesbartlett,CourseTechnology,andhundredsmore.FormoreinformationaboutSafariBooksOnlinepleasevisitusonline
2017/10/13 19:32:36 13.09MB Practical Statistics Data Scientists
1
Whatyouwilllearnfromthisbook*UnderstandhowtoeffectivelyuseMicrosoftDynamicsSureSteptoimplementtherightMicrosoftDynamicsbusinesssolutionwithquality,on-timeandon-budgetresults.*Learnbusinesssolutionsellingtechniquesandguidancetoaccelerateandcloseasale,aswellasrelatedguidanceonspecificindustries*DiscoverhowMicrosoftDynamicsSureStepsupport'syourbuycycle,asyouprogressthroughyourneedsassessment,alternativesassessmentandriskassessmentstages*Examinethedifferentoptionstochoosefromforyourbusinesssolutiondelivery,includingwaterfallandagileapproaches*Acquireinsightsintohowyoucanproactivelyoptimizethebusinesssolutionduringimplementation,aswellascontinuetomaintainthehealthofyoursolutioninproduction*Determinetheapproachandtoolsavailabletoupgradeyourbusinesssolutionstothecurrentproductreleases*GainknowledgeinkeyareassuchastheprojectandchangemanagementdisciplinesprovidedinMicrosoftDynamicsSureStep*FamiliarizeyourselfwiththeapproachtoadoptingtheMicrosoftDynamicsSureStepmethodologyasyourown
2017/2/23 12:32:55 18.4MB Microsoft Dynamics Sure Step
1
基于netcdfAll-4.2.jar读取气象科学数据(.nc格式)文件,解析数据内容后,通过GDAL解析生成tiff文件,tiff文件的灰度值就是对于气象科学数据的监测值,基于tiff数据,结合gis软件,可以生产在b/s浏览的地图图层,可实现基于地图,展现气象科学数据。
2015/5/8 2:40:50 10.83MB 气象科学数据 .nc tiff
1
ThereisanexplosionofinterestinBayesianstatistics,primarilybecauserecentlycreatedcomputationalmethodshavefinallymadeBayesiananalysistractableandaccessibletoawideaudience.DoingBayesianDataAnalysis,ATutorialIntroductionwithRandBUGS,isforfirstyeargraduatestudentsoradvancedundergraduatesandprovidesanaccessibleapproach,asallmathematicsisexplainedintuitivelyandwithconcreteexamples.Itassumesonlyalgebraand‘rusty’calculus.Unlikeothertextbooks,thisbookbeginswiththebasics,includingessentialconceptsofprobabilityandrandomsampling.Thebookgraduallyclimbsallthewaytoadvancedhierarchicalmodelingmethodsforrealisticdata.ThetextprovidescompleteexampleswiththeRprogramminglanguageandBUGSsoftware(bothfreeware),andbeginswithbasicprogrammingexamples,workingupgraduallytocompleteprogramsforcomplexanalysesandpresentationgraphics.Thesetemplatescanbeeasilyadaptedforalargevarietyofstudentsandtheirownresearchneeds.ThetextbookbridgesthestudentsfromtheirundergraduatetrainingintomodernBayesianmethods.Accessible,includingthebasicsofessentialconceptsofprobabilityandrandomsamplingExampleswithRprogramminglanguageandBUGSsoftwareComprehensivecoverageofallscenariosaddressedbynon-bayesiantextbooks-t-tests,analysisofvariance(ANOVA)andcomparisonsinANOVA,multipleregression,andchi-square(contingencytableanalysis).CoverageofexperimentplanningRandBUGScomputerprogrammingcodeonwebsiteExerciseshaveexplicitpurposesandguidelinesforaccomplishment作者从概率统计和编程两方面入手,由浅入深地指点读者如何对实际数据进行贝叶斯分析。
全书分成三部分,第一部分为基础篇:关于参数、概率、贝叶斯法则及R软件,第二部分为二元比例推断的基本理论,第三部分为广义线性模型。
内容包括贝叶斯统计的基本理论、实验设计的有关知识、以层次模型和MCMC为代表的复杂方法等。
同时覆盖所有需要用到非贝叶斯方法的情况,其中包括:t检验,方差分析(ANOVA)和ANOVA中的多重比较法,多元线性回归,Logistic回归,序列回归和卡方(列联表)分析。
针对不同的学习目标(如R、BUGS等)列出了相应的重点章节;
整理出贝叶斯统计中某些与传统统计学可作类比的内容,方便读者快速学习。
本中提出的方法都是可操作的,并且所有涉及数学理论的地方都已经用实际例子非常直观地进行了解释。
由于并不对读者的统计或
2018/9/5 21:06:32 9.93MB 贝叶斯 Bayesian Data Analysis
1
所需的软件包:麻痹大熊猫OpenCVkffmpeg描述:该脚本有助于自动化力数据分析。
该程序分为两个步骤,可以相互独立运行,尽管步骤2需要步骤1的输出+手动包含脚步帧。
步骤1:运行main.py,设置Step1=True,Step2=False。
在对话框中打开文件夹,其中包含蜥蜴的视频。
.../Gecko01/videos_analysis步骤1完成后,包含所有文件名,个人名称,视频信息和4个空列“footfall_begin”,“footfall_end”,“foot”和“notes”的.csv文件(例如Gecko01_forceAnalysis.csv)将保存到所选文件夹中现在,您需要将脚步和脚的帧号(FL,FR,HR或HL)添加到此csv文件中。
如果需要,请在“注释”列中做注释,这些注释将被传输到最终文件中。
保存文件
2022/9/8 9:36:14 709.17MB Python
1
TheGPUPro:AdvancedRenderingTechniquesbookseriescoversready-to-useideasandproceduresthatcansolvemanyofyourdailygraphics-progra妹妹ingchallenges.Thefirstbookintheserieswouldn’thavebeenpossiblewithoutthehelpofmanypeople.FirstofallIwouldliketothankthesectioneditorsforthefantasticjobtheydid.TheworkofWessamBahnassi,SebastienSt.Laurent,NatalyaTatarchuk,CarstenDachsbacher,MatthiasWloka,ChristopherOat,andSa妹妹artinensuresthatthequalityoftheseriesstandsuptotheexpectationsofourreaders.ThegreatcoverscreenshotsweretakenfromCallofJuarez:BoundinBlood.IwouldliketothankTechlandforallowingustousethoseshots.Youwillalsofindapostmortemofthisgameinthebook.TheteamatAKPetersmadethewholeprojecthappen.IwanttothankAliceandKlausPeters,CharlotteHenderson,andthewholeproductionteam,whotookthearticlesandmadethemintoabook.Specialthanksgoouttoourfamiliesandfriends,whospentmanyeveningsandweekendsduringthelongbookproductioncyclewithoutus.Ihopeyouhaveasmuchfunreadingthebookaswehadcreatingit.—WolfgangEngel
2022/9/6 13:58:20 37.99MB GPU Pro
1
(含源码及报告)本程序分析了自2016年到2021年(外加)每年我国原油加工的产量,并且分析了2020年全国各地区原油加工量等,含饼状图,柱状图,折线图,数据在地图上显示。
运转本程序需要requests、bs4、csv、pandas、matplotlib、pyecharts库的支持,如果缺少某库请自行安装后再运转。
文件含6个excel表,若干个csv文件以及一个名字为render的html文件(需要用浏览器打开),直观的数据处理部分是图片以及html文件,可在地图中显示,数据处理的是excel文件。
不懂可以扫文件中二维码在QQ里面问。
2022/9/30 16:31:44 29.75MB 爬虫 python 源码软件 开发语言
1
LeetCodecpp最新中文题解.pdfLeetCodecpp最新中文题解.pdfLeetCodecpp最新中文题解.pdf目录3.4Addbinary615.1.5BinaryTreeLevelOr-3.5LongestPalindromicSubstring.62dertraversalil3.6RegularExpressionMatching665.1.6BinaryTreeZigzag3.7WildcardMatching67LevelOrdertraversal.963.8LongestCommonPrefix5.1.7RecoverBinarySearch3.9ValidNumber70Tree983.10Integertoroman725.1.8SameTree3.11RomantoInteger735.1.9SymmetricTree1003.12CountandSay745.1.10BalancedBinaryTree..1023.13Anagrams755.1.11FlattenBinaryTreeto3.14SimplifyPath76LinkedList1033.15LengthofLastWord775.1.12PopulatingNextRightPointersineachnodeii105第4章栈和队列7952二叉树的构建10641栈795.2.1ConstructBinaryTree4ValidParentheses79fromPreorderandIn4.1.2LongestvalidParenorderTraversa106theses805.2.2ConstructBinaryTree4.1.3LargestRectangleinfromInorderandposHistogram82torderTraversal1074.1.4Evaluatereversepol-53二叉查找树108ishnotation845.3.1UniqueBinarySearch4.2队列85Trees.1085.3.2UniqueBinarySearch第5章树86Treesli.1105.1二叉树的遍历865.3.3ValidateBinarySearch5.1.1BinaryTreePreorderTreeTraversal865.3.4ConvertSortedarrayto5.1.2BinaryTreeInorderBinarySearchTree...112Traversal885.3.5ConvertSortedListto5.1.3BinaryTreePostorderBinarySearchTree113Traversal9054二叉树的递归.1145.1.4BinaryTreeLevelOr5.4.1MinimumDepthofBidertraversal)2narylree115目录5.4.2MaximumDepthofBi8.3.,2重新实现nextpermunaryTree116tation1425.4.3PathSum11783.3递归.1435.44PathSumil1188.4PermutationsII1445.4.5BinaryTreeMaximum8.4.1nextpermutation...144PathSuum11984.2重新实现nextpermu5.4.6PopulatingNextRighttation144Pointersineachnode120843递归1445.4.7SumRoottoLeafnum8.5Combinations146bers2185.1递归1468.5.2迭代147第6章排序1238.6LetterCombinationsofaphone6.1MergeSortedArray123umber1476.2MergeTwoSortedLists12486.1递归1486.3MergekSortedLists124862迭代96.4InsertionSortList125第9章广度优先搜索1506.5Sortlist1269.1WordLadder1506.6FirstMissingPositive1279.2WordLadderil1546.7SortColors1289.3Surroundedregions162第7章查找94小结16413194.l适用场景1647.1Searchforarange131942思考的步骤7.2SearchInsertPosition.13294.3代码模板1657.3Searcha2DMatrix133第10章深度优先搜索173第8章暴力枚举法13510.1PalindromePartitioning1738.1Subsets13510.2UniquePaths1768.1.1递归1350.2.1深搜1768.1.2迭代.1371022备忘录法.1768.2Subsetsil13810.23动规177821递归13810.24数学公式1788.2.2迭代.14110.3UniquePathsIl1798.3Permutations14210.3.1备忘录法1798.3.1nextpermutation14210.3.2动规.180目录10.4N-Queens1813.4Maximalrectangle21310.5N-QueensII18413.5BestTimetoBuyandSellStock10.6Restoreipaddresses186.21410.7CombinationSum18813.6InterleavingString21510.8CombinationSumIl18913.7ScrambleString21710.9GenerateParentheses.19013.8MinimumPathSum.22210.10Sudokusolver19213.9EditDistance22410.11WordSearch.19313.10DecodeWays.22610.12小结19513.11Distinctsub22710.12.1适用场景19513.12WordBreak22810.122思考的步骤1951313WordBreakil2300.12.3代码模板197第14章图23210.12.4深搜与回溯法的区別.19714.1CloneGraph23210.12.5深搜与递归的区别..197第15章细节实现题235第11章分治法19915.1ReverseInteger2351.1Pow(x,n)19915.2PalindromeNumber.23611.2Sqrt(x)20015.3InsertInterval237第12章贪心法20115.4MergeIntervals23812.1Jumpgame20115.5MinimumWindowSubstring23912.2JumpgameII15.6MultiplyStrings24112.3BestTimetobuyandSellstock20415.7SubstringwithConcatenation12.4BestTimetobuyandsellstockl205ofallwords24412.5LongestSubstringWithoutre15.8Pascal,sTriangle245peatingCharacters20615.9PascalsTriangleIl24612.6ContainerwithMostWater..20715.10SpiralMatrix24715.11SpiralmatrixII248第13章动态规划20915.12ZigZagConversion25013.1Triangle20915.13DivideTwoIntegers25113.2MaximumSubarray15.14TextJustification25313.3PalindromePartitioningII1215.15MaxPointsonaline255目录第1章编程技巧在判断两个浮点数a和b是否相等时,不要用a==b,应该判断二者之差的绝对值fabs(a-b)是否小于某个阈值,例如1e-9。
判断一个整数是否是为奇数,用x%2!=0,不要用x%2=1,因为ⅹ可能是负用char的值作为数组下标(例如,统计字符串中每个字符岀现的次数),要考虑到char可能是负数。
有的人考虑到了,先强制转型为unsignedint再用作下标,这仍然是错的。
正确的做法是,先强制转型为unsignedchar,再用作下标。
这涉及C十整型提升的规则,就不详述了。
以下是关于STL使用技巧的,很多条款来自《EffectiveSTL》这本书。
vector和string优先于动态分配的数组首先,在功能上,由于vector能够保证连续内存,因此一旦分配了后,它的功能跟原始数组相当;其次,如果用new,意味着你要确保后面进行孓delete,一旦忘记了,就会出现BUG,且这样需要都写一行delete,代码不够短再次,声明多维数组的话,只能一个一个new,例如int**ary=newint*[row_num];for(inti=0:i<rownum;++1)ary[i]newint[col_num]用vector的话一行代码搞定vector<vector<int>>ary(row_num,vector<int>(col_num,0))使用reserve来避免不必要的重新分配第2章线性表这类题目考察线性表的操作,例如,数组,单链表,双向链表等。
2数组2.1.1RemoveDuplicatesfromSortedarray描述Givenasortedarray,removetheduplicatesinplacesuchthateachelementappearonlyonceandreturnthenewlengthDonotallocateextraspaceforanotherarray,youmustdothisinplacewithconstantmemoryForexample,GiveninputarrayA=[1,1,2Yourfunctionshouldreturnlength=2,andaisnow[1,2]分析无代码1/LeetCode,RemoveDuplicatesfromSortedArray//时间复杂度0(n),空间复杂度0(1)classSolutiontublicintremoveDuplicates(vector<int>&nums)tif(numsemptyo)return0;intindex=ofor(inti=1:inumssize:1++iif(nums[index]!nums[i])nums[++index]=nums[i]returnindex12.1数组代码2//LeetCode,RemoveDuplicatesfromSortedArray/使用STL,时间复杂度0(n),空间复杂度0(1)classSolutionipublicintremoveDuplicates(vector<int>&nums)treturndistance(numsbegin(),unique(numsbegin(),numsend())代码3/LeetCode,RemoveDuplicatesfromSortedArray/使用STL,时间复杂度0(n),空间复杂度0(1)lassSolutionfublicintremoveDuplicates(vector<int>&nums)treturndistance(numsbegin(,removeDuplicates(numsbegin(,numsend(),numsbegintemplate<typenameInIt,typenameoutit>OutItremoveDuplicates(InItfirst,InItlast,OutItoutput)thile(firstlast)i*output++=*firstfirstupper_bound(first,last,*firstreturnoutput相关题目RemoveDuplicatesfromSortedArrayI,见§2.1.22.1.2RemoveDuplicatesfromSortedArrayII描述Followupfor"RemoveDuplicates"Whatifduplicatesareallowedatmosttwice?Forexample,Givensortedarraya=[1,1,1,2,2,3]Yourfunctionshouldreturnlength=5,andAisnow[1,1,2,2,3分析加一个变量记录一下元素出现的次数即可。
这题因为是已经排序的数组,所以一个变量即可解决。
如果是没有排序的数组,则需要引入一个hashmap来记录出现次数。
4第2章线性表代码1//LeetCode,RemoveDuplicatesfromSortedArrayII//时间复杂度0(n),空间复杂度0(1)//qauthorhex108(https://github.com/hex108)classSolutiontublicintremoveDuplicates(vector<int>&nums)tif(numssize(<=2)returnnumssizeintindex=2for(inti=2:inumssize(:i++)ff(nums[i]!numslindex-2]nums[index++]=nums[i]returnindex;代码2下面是一个更简洁的版本。
上面的代码略长,不过扩展性好一些,例如将occur<2改为occur3,就变成了允许重复最多3次。
//LeetCode,RemoveDuplicatesfromSortedArrayII7/@author虞航仲(http://weibo.com/u/1666779725)//时间复杂度0(n),空间复杂度0(1)lassSolutionfpublicintremoveDuplicates(vector<int>&nums)tconstintn=numssizeintindex=0:for(inti=0:i<n;++i)if(i>0&&i<n-1&nums[i]=nums[i-1]&nums[i]=nums[i1])continue;nums[index++]=nums[i]returnindex;相关题目RemoveDuplicatesfromSortedArray,见§2.1.1
2019/5/20 21:34:34 866KB why
1
在日常工作中,钉钉打卡成了我生活中不可或缺的一部分。然而,有时候这个看似简单的任务却给我带来了不少烦恼。 每天早晚,我总是得牢记打开钉钉应用,点击"工作台",再找到"考勤打卡"进行签到。有时候因为工作忙碌,会忘记打卡,导致考勤异常,影响当月的工作评价。而且,由于我使用的是苹果手机,有时候系统更新后,钉钉的某些功能会出现异常,使得打卡变得更加麻烦。 另外,我的家人使用的是安卓手机,他们也经常抱怨钉钉打卡的繁琐。尤其是对于那些不太熟悉手机操作的长辈来说,每次打卡都是一次挑战。他们总是担心自己会操作失误,导致打卡失败。 为了解决这些烦恼,我开始思考是否可以通过编写一个全自动化脚本来实现钉钉打卡。经过一段时间的摸索和学习,我终于成功编写出了一个适用于苹果和安卓系统的钉钉打卡脚本。
2024-04-09 15:03 15KB 钉钉 钉钉打卡