码迷,mamicode.com
首页 >  
搜索关键字:cas array    ( 36241个结果
[ LeetCode ] Longest Common Prefix
题目 Write a function to find the longest common prefix string amongst an array of strings. 原题链接 解题思想 给一个字符串数组,求这些字符串的最长公共前缀。 这个题应该是比较简单的,直接写代码,一次AC。解题思想是依次对数组中的字符串求最长公共前缀。 代码实现 class Sol...
分类:其他好文   时间:2014-06-20 12:25:09    阅读次数:247
LeetCode: Convert Sorted Array to Binary Search Tree [108]
【题目】 Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 【题意】 给定一个已排序的数组(不存在重复元素),将它转换成一棵平衡二叉搜索树。 【思路】 由于平衡二叉树要求左右子树的高度差绝对值相遇等于1,也就是说左右子树尽可能包含相同数目节点。 则使用二分法来解本题即可。...
分类:其他好文   时间:2014-06-20 11:03:31    阅读次数:246
《Javascript权威指南》学习笔记之十二:数组、多维数组和符合数组(哈希映射)
Array(数组)是JavaScript中较为复杂的数据类型,同Java、C#、VB等程序语言的数组相比,Javascript数组中的元素不必为相同的数据类型,可以在数组每个元素上混合使用数字、日期、字符串、Object,甚至添加一个嵌套数组。...
分类:编程语言   时间:2014-06-20 10:15:11    阅读次数:297
leetcode--Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[?2,1,?3,4,?1,2,1,...
分类:其他好文   时间:2014-06-20 08:59:38    阅读次数:235
leetcode--Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST./** * Definition for binary tree * public class TreeN...
分类:其他好文   时间:2014-06-11 21:58:10    阅读次数:300
通过连接池和字段索引,提升单点登录cas的性能
cas是多个系统的中心认证,认证的过程就是用户的登录信息和数据库中的信息匹对的过程,假设某一时刻登录的人数非常多,须要频繁的读取数据库,数据库连接的管理就是问题。前天測试评教时无意之中把单点登录的问题暴露出来了,平时通过cas登录管理端是没有问题的,而200人同一时候通过cas登陆学生端时出现异常o...
分类:其他好文   时间:2014-06-11 11:30:51    阅读次数:394
[leetcode]Search Insert Position @ Python
原题地址:https://oj.leetcode.com/problems/search-insert-position/题意:Given a sorted array and a target value, return the index if the target is found. If n...
分类:编程语言   时间:2014-06-11 11:28:40    阅读次数:349
[leetcode]Plus One @ Python
原题地址:https://oj.leetcode.com/problems/plus-one/题意:Given a non-negative number represented as an array of digits, plus one to the number.The digits are...
分类:编程语言   时间:2014-06-11 11:25:27    阅读次数:304
LeetCode: Convert Sorted List to Binary Search Tree [109]
【题目】 Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 【题意】 将一个有序链表转换成平衡二叉树 【思路】 思路跟Convert Sorted Array to Binary Search Tree完全一样...
分类:其他好文   时间:2014-06-07 16:20:05    阅读次数:287
关于结构体的一个特殊用法(总觉得遇到的问题就该记录一下哇)
关于结构体的一个特殊用法 //写法一 struct array { int count; char *buf; } //写法二 struct array { int count; char buf[0]; } 如果一个buf用作一个buffer的话,这时候如果malloc一块内存, 用方法一,buf是指针的话,指向这块申请出的内存的话,这里arr...
分类:其他好文   时间:2014-06-07 12:13:20    阅读次数:273
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!