码迷,mamicode.com
首页 >  
搜索关键字:算法 递归    ( 98246个结果
leetcode -day19 Convert Sorted List to Binary Search Tree
1、 ?? Convert Sorted List to Binary Search Tree  Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 分析:将一个升序排列的链表转换为平衡二叉搜索树,采用递归的方式,先找到链表...
分类:其他好文   时间:2014-05-22 12:33:30    阅读次数:270
LeetCode: Search in Rotated Sorted Array [032]
【题目】 Suppose 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. If found in the array return its index, otherwise return -1. You may assume no du...
分类:其他好文   时间:2014-05-22 10:43:12    阅读次数:310
14年广东省赛,北师邀请赛
广东省赛: 这次比赛充分反映出我队的基本功不扎实,搜索,dp,字符串领域都不太扎实,团队能力基本是三家猫。 同时卡三个题,两个wa找不出错,TLE的那个又毫无办法 需要深刻反省的是 1:平时训练不够扎实,浮在表面,并没有认真对待每一套题 2:算法学得不够扎实,什么都能说一点等于什么都不会 3:卡题之后并不能冷静地处理问题,心态不够成熟 对待失败一定要直面,然后总结,逃避只会让你越来越...
分类:其他好文   时间:2014-05-22 10:21:30    阅读次数:266
LeetCode: Valid Sudoku [035]
【题目】 Determine 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 partially filled sudoku which is valid. Note: A valid Sudoku board (par...
分类:其他好文   时间:2014-05-22 09:58:54    阅读次数:234
LeetCode: Search Insert Position [034]
【题目】 Given 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 duplicates in the array. Here are few examples. [1,3,5,6], 5 → 2 [1,3,5,6]...
分类:其他好文   时间:2014-05-22 09:41:59    阅读次数:195
[BASIC-18] 矩形面积交
基础练习 矩形面积交   时间限制:1.0s   内存限制:512.0MB 问题描述   平面上有两个矩形,它们的边平行于直角坐标系的X轴或Y轴。对于每个矩形,我们给出它的一对相对顶点的坐标,请你编程算出两个矩形的交的面积。 输入格式   输入仅包含两行,每行描述一个矩形。   在每行中,给出矩形的一对相对顶点的坐标,每个点的坐标都用两个绝对值不超过10...
分类:其他好文   时间:2014-05-22 08:58:39    阅读次数:265
[BASIC-17] 矩阵乘法
基础练习 矩阵乘法   时间限制:1.0s   内存限制:512.0MB 问题描述   给定一个N阶矩阵A,输出A的M次幂(M是非负整数)   例如:   A =   1 2   3 4   A的2次幂   7 10   15 22 输入格式   第一行是一个正整数N、M(1   接下来N行,每行N个绝对值不超过10的非负整数,描述矩阵A的...
分类:其他好文   时间:2014-05-22 08:18:47    阅读次数:274
蚁群算法
蚁群算法(ant colony optimization, ACO),又称蚂蚁算法,是一种用来在图中寻找优化路径的机率型算法。它由Marco Dorigo于1992年在他的博士论文中提出,其灵感来源于蚂蚁在寻找食物过程中发现路径的行为。蚁群算法是一种模拟进化算法,初步的研究表明该算法具有许多优良的性质。针对PID控制器参数优化设计问题,将蚁群算法设计的结果与遗传算法设计的结果进行了比较,数值仿真结果表明,蚁群算法具有一种新的模拟进化优化方法的有效性和应用价值。...
分类:其他好文   时间:2014-05-22 07:01:20    阅读次数:207
LeetCode: Search for a Range [033]
【题目】 Given 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 the target is not found in the array, return [-1, -1]. For example, Given [5...
分类:其他好文   时间:2014-05-22 06:44:39    阅读次数:265
linux下的mysql修改默认编码
linux下永久修改mysql默认编码...
分类:数据库   时间:2014-05-20 15:52:32    阅读次数:410
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!