1.、注册appfog 2、注册之后,新建一个javaspringmysql应用。 3、选择第一个亚洲服务器(据说最快) 4、写上应用名。 5、进入应用默认界面 6、点击updatesourcecode,按照它的说明一步一步来很简单的。 7、接下来你就可以上传自己的代码了,myeclipse写好的应用打包成war包,然后解压,用startcommandpromptruby上传就ok了。 8、下面讲数据库连接,先写个jsp页面里面加一句out.println(System.getenv("VCAP_SERVICES"));把它的值打印出来,得到一串字符串,...

  iVhBmnbWORLX   2023年11月02日   49   0   0 字符串mysql数据库连接

题目链接:https://leetcode.com/problems/customers-who-never-order/ 题目:Supposethatawebsitecontainstwotables,theCustomerstableandtheOrderstable.WriteaSQLquerytofindallcustomerswhoneverorderanything. Table:Customers. +—-+——-+ |Id|Name| +—-+——-+ |1|Joe| |2|Henry| |3|Sam| |4|Max| +—-+——-+ Table:Orders.+—-+—...

  iVhBmnbWORLX   2023年11月02日   52   0   0 leetcodeMaxsql

题目链接:https://leetcode.com/problems/rotate-image/ 题目: n x n Rotatetheimageby90degrees(clockwise). Followup:Couldyoudothisin-place? 思路: 先将矩阵转置,再将矩阵按中轴线对称交换每一列。 算法: publicvoidrotate(int[][]matrix){ for(inti=0;i<matrix.length;i){//转置 for(intj=i;j<matrix[0].length;j){ inttmp=m...

  iVhBmnbWORLX   2023年11月02日   59   0   0 i++转置矩阵转置

题目链接:https://leetcode.com/problems/move-zeroes/ 题目: nums,writeafunctiontomoveall 0'stotheendofitwhilemaintainingtherelativeorderofthenon-zeroelements.nums=[0,1,0,3,12],aftercallingyourfunction, nums shouldbe [1,3,12,0,0]. Note: Youmustdothis in-place Minimizethetotalnumber...

  iVhBmnbWORLX   2023年11月02日   66   0   0 i++删除操作数组

题目链接:https://leetcode.com/problems/search-for-a-range/ 题目: Givenasortedarrayofintegers,findthestartingandendingpositionofagiventargetvalue. O(log n). [-1,-1].Forexample, Given [5,7,7,8,8,10] andtargetvalue8, return [3,4]. 思路: 1、暴力,直接搜索,时间复杂度O(n) 2、二分搜索,时间复杂度O(logn) 算法1: public...

  iVhBmnbWORLX   2023年11月02日   84   0   0 i++搜索时间复杂度

题目链接:https://leetcode.com/problems/counting-bits/ 题目: num.Foreverynumbers i intherange 0≤i≤num Example: For num=5 youshouldreturn [0,1,1,2,1,2]. Followup: Itisveryeasytocomeupwithasolutionwithruntime O(nsizeof(integer)).Butcanyoudoitinlineartime O(n) Spaceco...

  iVhBmnbWORLX   2023年11月02日   40   0   0 i++c++状态转移

题目链接:https://leetcode.com/problems/pascals-triangle-ii/ 题目: th Forexample,given k =3, Return [1,3,3,1]. Note:Couldyouoptimizeyouralgorithmtouseonly O(k)extraspace? 思路: 要求空间复杂度为O(k),其实只需要记录前一行的结果就可以了。 算法: [java] viewplain copy   1.publicList<Integer>ge...

  iVhBmnbWORLX   2023年11月02日   43   0   0 javaList空间复杂度

题目链接:https://leetcode.com/problems/binary-tree-inorder-traversal/ 题目: inorder Forexample: Givenbinarytree {1,,2,3}, 1\2/3 [1,3,2]. Note: 思路: 用栈模拟中序遍历过程 算法: publicList<Integer>inorderTraversal(TreeNoderoot){ List<Integer>list=newArrayList<Integer>(); Stack<TreeNode&...

  iVhBmnbWORLX   2023年11月02日   37   0   0 子树StackList

题目链接:https://leetcode.com/problems/summary-ranges/ 题目: Givenasortedintegerarraywithoutduplicates,returnthesummaryofitsranges. [0,1,2,4,5,7],return ["0->2","4->5","7"]. 思路: 直接做就好了,时间复杂度O(n) 算法: publicList<String>summaryRanges(int[]nums){ List<String>result=newArrayList<...

  iVhBmnbWORLX   2023年11月02日   62   0   0 时间复杂度i++List

题目链接:https://leetcode.com/problems/product-of-array-except-self/ 题目: n integerswhere n >1, nums,returnanarray output suchthat output[i] isequaltotheproductofalltheelementsof nums except nums[i]. Solveit withoutdivision andinO(n). [...

  iVhBmnbWORLX   2023年11月02日   95   0   0 数组i++空间复杂度

题目链接:https://leetcode.com/problems/remove-duplicates-from-sorted-array/ 题目: once Donotallocateextraspaceforanotherarray,youmustdothisinplacewithconstantmemory. Forexample, Giveninputarray nums = [1,1,2],2,withthefirsttwoelementsof nums being 1 and 2 思路: 思路跟 一...

  iVhBmnbWORLX   2023年11月02日   116   0   0 i++

题目链接:https://leetcode.com/problems/verify-preorder-serialization-of-a-binary-tree/ 题目: . _9_/\32/\/\416/\/\/\ "9,3,4,,,1,,,2,,6,,",where  Givenastringofcommaseparatedvalues,verifywhetheritisacorrectpreordertraversalserializationofabinarytree.Findanalgorithmwithoutreconstructingthetree. ''&nbs...

  iVhBmnbWORLX   2023年11月02日   82   0   0 i++Stack

题目链接:https://leetcode.com/problems/first-missing-positive/ 题目: Givenanunsortedintegerarray,findthefirstmissingpositiveinteger. Forexample, Given [1,2,0] return 3, and [3,4,-1,1] return 2. O(n)timeandusesconstantspace. 思路: 让数组中的数”坐在“这个数对应的下标上,比如1应该放在第一个位置,4应该放在第四个位置。 算法...

  iVhBmnbWORLX   2023年11月02日   29   0   0 数组i++

Given n non-negativeintegersrepresentinganelevationmapwherethewidthofeachbaris1,computehowmuchwateritisabletotrapafterraining. Forexample,  Given [0,1,0,2,1,0,1,3,2,1,2,1],return 6. ThanksMarcos 思路: 用两个数组,leftMax[i]表示左边到i-1为之最高的高度,rightMax同上。 某位置能存储的水量等于min{leftMax[i],right...

  iVhBmnbWORLX   2023年11月02日   28   0   0 数组i++Math
关注 更多

空空如也 ~ ~

粉丝 更多

空空如也 ~ ~