`
淡淡的一抹
  • 浏览: 18995 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表

CSS引用方式

    博客分类:
  • CSS
1 外部引用方式   像.js文件一样,CSS代码也可以写在一个独立的文件中,然后在页面中引用这个文件。理论上,文件的后缀名是没有限制的,单通常CSS文件都以.css作为文件后缀。可以使用HTML标签对.css文件进行引用,例如: <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet&q ...

CSS注意事项(1)

    博客分类:
  • CSS
1 理论上,在CSS中ID的意思是唯一,但是HTML并没有对ID重复做任何限制,只能由编码者自己限制。同时需要注意:当在JavaScript中涉及ID的操作时,例如getElementById,如果ID重复,将会导致错误的结果。
String和StringBuffer的区别,网上资料可以说是数不胜数,但是看到这篇文章,感觉里面做的小例子很有代表性,所以转一下,并自己做了一点总结。 在java中有3个类来负责字符的操作。 1.Character 是进行单个字符操作的, 2.String 对一串字符进行操作。不可变类。 3.StringBuffer 也是对一串字符进行操作,但是可变类。 String: 是对象不是原始类型. 为不可变对象,一旦被创建,就不能修改它的值. 对于已经存在的String对象的修改都是重新创建一个新的对象,然后把新的值保存进去. String 是final类,即不能被继承. Str ...
         StringBuffer类和String一样,也用来代表字符串,只是由于StringBuffer的内部实现方式和String不同,所以StringBuffer在进行字符串处理时,不生成新的对象,在内存使用上要优于String类。          所以在实际使用时,如 ...

String to Integer (atoi)

 
题目描述 Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases. Notes: It is intended for this problem to be specified vaguely (ie, no given input specs). Y ...

Implement strStr()

题目描述 Implement strStr(). Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack. 解题思路 本题最经典的算法是KMP算法,具体可以参考http://www.cnblogs.com/dolphin0520/archive/2011/08/24/2151846.html。自己采用BF算法这种基本算法实现的。 自己的代码 package leetcode; public class ImplementSt ...

Valid Palindrome

题目描述 Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, "A man, a plan, a canal: Panama" is a palindrome. "race a car" is not a palindrome. Note: Have you consider that the string might be empty? This is a ...

ZigZag Conversion

题目描述 The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P   A   H   N A P L S I I G Y   I   R And then read line by line: "PAHNAPLSIIGYIR" Write the code t ...

Count and Say

题目描述 The 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 read off as "one 2, then one 1" or 1211. Given an integer n, generate the nth sequence ...
题目描述 Write a function to find the longest common prefix string amongst an array of strings. 解题思路 本题要求找出所有字符串的公共前缀。思路是利用set的所有元素的唯一性,首先找到所有的可能子串,然后确定是否为公共子串。 相关知识点 (1)Java中的set遍历 1.迭代遍历: Set<String> set = new HashSet<String>(); Iterator<String> it = set.iterator(); while ...

Add Binary

题目描述 Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 解题思路 本题考查对字符串和容器的使用。主要思想是将a,b转化为列表处理,然后从低位到高位一次进行进位操作。 相关知识点 (1)对一个容器进行逆序操作 Collections.reverse(list); 自己的代码 package leetcode; import java.util.Arr ...

Valid Sudoku

题目描述 Determine if a Sudoku is valid, according to: The Sudoku board could be partially filled, where empty cells are filled with the character '.'. Note: A valid Sudoku board (partially filled) is not necessarily solvable. Only the filled cells need to be validated. 解题思路 本题要求判断是否为九宫格。而九宫格为http:// ...

Valid Parentheses

题目描述 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and "()[]{}" are all valid but "(]" and "([)]" are not. 解题思路 本题考查的是判断一个字符串是否为正确括号的使用 ...

Palindrome Number

题目描述 Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1) If you are thinking of converting the integer to string, note the restriction of using extra space. You could also try reversing an integer. However, if you ...

Length of Last Word

题目描述 Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word does not exist, return 0. Note: A word is defined as a character sequence consists of non-space characters only. For example, Given s = " ...
Global site tag (gtag.js) - Google Analytics