摘要: Reverse a singly linked list. 之前错误: 把p->next=head; 写成 ln->next=head; ln是返回链表的头指针 阅读全文
posted @ 2016-03-21 14:58 白天黑夜每日c 阅读(112) 评论(0) 推荐(0) 编辑
摘要: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文
posted @ 2016-03-21 14:41 白天黑夜每日c 阅读(140) 评论(2) 推荐(0) 编辑
摘要: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr 阅读全文
posted @ 2016-03-21 14:23 白天黑夜每日c 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A的ascii: 65 阅读全文
posted @ 2016-03-21 10:25 白天黑夜每日c 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "nagaram", return true.s = "rat", t = 阅读全文
posted @ 2016-03-21 10:08 白天黑夜每日c 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical a 阅读全文
posted @ 2016-03-21 09:50 白天黑夜每日c 阅读(129) 评论(0) 推荐(0) 编辑