- 博客(78)
- 资源 (1)
- 收藏
- 关注
转载 Linux下 环境变量/etc/profile、/etc/bashrc、~/.bashrc的区别
最近配置了JAVA和Scala的环境变量,发现自己对Linux下 /etc/profile、/etc/bashrc、~/.bashrc的区别不是特别清楚,特此查阅了相关资料,整理下来,供以后查阅。如有错误之处,还望各位朋友批评指正。①/etc/profile: 该文件登录操作系统时,为每个用户设置环境信息,当用户第一次登录时,该文件被执行。也就是说这个文件对每个shell都有效,用于获
2016-12-14 12:33:28 336
转载 测试用例实例
测试用例编号N3310_IT_FILEITF_READFILE_004测试项目测试模块A提供的文件接口测试标题文件B正在被其他进程执行读/写操作,通过A模块的文件接口读取文件B中的数据重要级别高预置条件进程XProcess被创建并启动输入
2016-12-12 23:19:46 2607
转载 44. Wildcard Matching
题目:Wildcard MatchingImplement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequence).T
2016-12-01 23:06:22 287
转载 43. Multiply Strings
题目:Multiply Strings Given two numbers represented as strings, return multiplication of the numbers as a string.Note:The numbers can be arbitrarily large and are non-negative.Converting t
2016-12-01 15:12:57 221
原创 42. Trapping Rain Water
题目:Trapping Rain WaterGiven n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [
2016-11-29 16:32:11 362
原创 41. First Missing Positive
题目:First Missing Positive Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2. Your algorithm should run in O
2016-11-28 21:06:41 217
转载 40. Combination Sum II
题目:Combination Sum II Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inC where the candidate numbers sums to T.Each number in C may only be use
2016-11-27 11:23:15 219
转载 39. Combination Sum
题目:Combination Sum Given a set of candidate numbers (C) and a target number (T), find all unique combinations inC where the candidate numbers sums to T.The same repeated number may be chosen fro
2016-11-26 23:36:33 198
原创 38. Count and Say
题目:Count and SayThe count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is
2016-11-25 11:45:31 258
转载 37. Sudoku Solver
题目:Sudoku SolverWrite a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character '.'.You may assume that there will be only one unique solution.
2016-11-24 22:45:53 269
转载 awk里面执行shell/系统命令
先把文件列表存在filename文件中(1)awk '{system("rm $0")}' filename -------WRONG因为对于 system来说 $0 不再是某行全部的内容,而是 “sh” , 上面的命令相当于执行“ sh rm sh”具体例子:如有t,tt,ttt几个zone,需要删除。#zoneadm li
2016-11-23 23:44:51 1260
转载 关于struts2 的this.addFieldError
在后台RegistAction添加数组之后,如下图:具体例子: this.addFieldError("success", "注册成功"); return SUCCESS;那么在前台怎么显示呢,需要用下面这种方式: 显示全部的 错误消息(用addFieldError方法添加的 ) field1 显示指定的 field1字段的 错误消息
2016-11-23 23:24:15 556
原创 36. Valid Sudoku
题目:Valid SudokuDetermine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character'.'.A p
2016-11-23 22:04:24 298
原创 35. Search Insert Position
题目:Search Insert PositionGiven a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no
2016-11-22 20:10:22 175
原创 34. Search for a Range
题目:Search for a RangeGiven a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If
2016-11-22 16:59:48 216
转载 33. Search in Rotated Sorted Array
题目:Search in Rotated Sorted ArraySuppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search
2016-11-22 00:12:54 171
转载 32. Longest Valid Parentheses
题目:Longest Valid ParenthesesGiven a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parenth
2016-11-21 18:15:35 208
原创 31. Next Permutation
题目:Next PermutationImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it a
2016-11-18 16:24:56 237
转载 memset给整型数组赋初值
现有一个整型数组a[5],若要是用memset函数给每个元素赋初值1怎么做呢?是memset(a,1,5*sizeof(int))吗? 其实这样是不对的,memset是以字节为单位就是对array指向的内存的4个字节进行赋值,每个都用ASCII为1的字符去填充,转为二进制后,1就是00000001,占一个字节。一个INT元素是4字节,合一起就是00000001000000010
2016-11-18 11:17:47 1015
转载 30. Substring with Concatenation of All Words (又超时了,最后一个case没过)
You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) ins that is a concatenation of each word in words exactly once and w
2016-11-18 00:06:24 346
转载 29. Divide Two Integers
题目: Divide Two IntegersDivide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. 如被除数是100,除数是9,则100=9*8+9*2+9*1+1,即是100=9*2^3 + 9*2^1 +
2016-11-17 16:42:57 195
原创 29. Divide Two Integers(超时)
题目:Divide Two IntegersDivide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.利用相加的方法,直到和>被加数,打印出次数。代码:int divide(int dividend,
2016-11-16 16:08:41 183
原创 28. Implement strStr()
题目:Implement strStr()Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.找一个字符串B在另一个字符串A中的起始位置。需要注意NULL和""的区别。char *str = NULL //申明字符串指针s
2016-11-16 14:18:05 211
转载 向awk传递参数
http://bbs.linuxsky.net/viewthread.php?tid=18691)通过-v传递参数#typeset sub=1#gawk -F" " -v i=$sub '{print $i}' t12-file.txt |xargsname alice ryan2) 自定义变量 1) 定义变量: varname=value (自定义变量不需先声明后
2016-11-15 15:56:36 900
转载 Transpose File
Transpose FileTotal Accepted: 3876Total Submissions: 18849Difficulty: MediumContributors: AdminGiven a text file file.txt, transpose its content.You may assume that each row has the same num
2016-11-15 11:53:51 234
原创 25. Reverse Nodes in k-Group
题目:Reverse Nodes in k-GroupGiven a linked list, reverse the nodes of a linked listk at a time and return its modified list. If the number of nodes is not a multiple of k then left-out nodes in t
2016-11-15 00:17:42 171
转载 27. Remove Element
题目:Remove ElementGiven an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with c
2016-11-14 21:52:15 205
转载 26. Remove Duplicates from Sorted Array
题目:Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear onlyonce and return the new length.Do not allocate extra space for anothe
2016-11-14 17:00:21 192
原创 23. Merge k Sorted Lists
题目链接Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.合并k个有序的链表,我们假设每个链表的平均长度是n。这一题需要用到合并两个有序的链表子过程 算法1:最傻的做法就是先1、2合并,12结果和3合并,123结果和4合并,…,123
2016-11-11 16:47:23 318
转载 21. Merge Two Sorted Lists
题目:Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.多申请一个头结点,谁小,就把谁添加到头结点所在链表的后面。
2016-11-11 15:16:41 124
原创 24. Swap Nodes in Pairs
题目:Swap Nodes in PairsGiven a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should us
2016-11-11 13:29:42 149
原创 d23. Merge k Sorted Lists
题目:Merge k Sorted Lists Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.用递归两两数组进行合并。代码:void sort(struct ListNode** lists,int* number
2016-11-10 22:25:52 175
转载 d22. Generate Parentheses ( 以后不要钻牛角尖)
题目:Generate ParenthesesGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is: [ "((()))", "(()(
2016-11-09 16:21:57 239
原创 21. Merge Two Sorted Lists
题目:Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.开辟新的空间,比较大小,谁小就先存储谁。(浪费空间较多)
2016-11-08 19:04:37 180
原创 21. Merge Two Sorted Lists
题目:Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.比较大小,谁小就先存储谁,不开辟新的空间。(直接两链表相连)
2016-11-08 18:13:55 202
原创 20. Valid Parentheses
题目:Valid ParenthesesGiven a string containing just the characters '(', ')','{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "(
2016-11-07 23:52:37 170
转载 19. Remove Nth Node From End of List
题目: Remove Nth Node From End of List Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2.
2016-11-06 10:25:38 168
转载 18. 4Sum
题目:4SumGiven an array S of n integers, are there elements a,b, c, and d in S such that a + b +c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note: The s
2016-11-05 22:22:55 161
转载 18. 4Sum (Runtime Error)
题目:4Sum Given an array S of n integers, are there elements a,b, c, and d in S such that a + b +c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note:
2016-11-05 20:40:08 176
转载 18. 4Sum (超时)
题目:4Sum Given an array S of n integers, are there elements a,b, c, and d in S such that a + b +c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note:
2016-11-05 10:21:46 244
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人