High Performance Python
目录
1
Understanding Performant Python2
Profiling3
Lists and Tuples4
Dictionaries and Sets5
Iterators and Generators6
Matrix and Vector Computation7
Compil...
分类:
编程语言 时间:
2014-10-08 11:03:25
阅读次数:
448
Write a code to read and write a matrix in below given way.Note : no. indicates the sequence here.I/P1 2 34 5 67 8 9O/P 11 4 72 5 83 6 9for(i=0;i<row;...
分类:
其他好文 时间:
2014-10-08 08:09:24
阅读次数:
194
题目: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place? 分析: 二维数...
分类:
其他好文 时间:
2014-10-07 16:44:13
阅读次数:
311
题目大意:有一个全零的矩阵,有两个操作。
1.修改(x1,y1)到(x2,y2)的数,使它们取异或。
2.查询(x,y)的状态。
思路:二维树状数组,区间修改,单点查询。
CODE:
#include
#include
#include
#include
#define MAX 1010
using namespace std;
int cases;
i...
分类:
其他好文 时间:
2014-10-07 16:29:53
阅读次数:
164
Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l...
分类:
其他好文 时间:
2014-10-07 15:03:53
阅读次数:
130
Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did you use extra space?A s...
分类:
其他好文 时间:
2014-10-07 12:03:03
阅读次数:
231
UVA11992 - Fast Matrix Operations ( 线段树 + 区间修改 + 好题 )这是大白书上的例题,一直放着没有去A掉,这是一道线段树区间修改的好题。线段树中需要维护三个域 ,max, min, sum,也就是区间最大值,最小值,区间和题目大意:r 行 c 列 的全0矩阵,...
分类:
其他好文 时间:
2014-10-05 15:31:38
阅读次数:
192
构造数据: > dataset = matrix(c(1,2,
+ 1.2,2,
+ 8,9,
+ 0.9,1.8,
+ 7,10,
+ 8.8,9.2), nrow=6, byrow=T)
> dataset
[,1] [,2]
[1,] 1.0 2.0
[2,] 1.2 2.0
[3,] 8.0 9.0
[4,] 0.9 1.8
[5,] 7.0 1...
分类:
其他好文 时间:
2014-10-05 15:27:28
阅读次数:
373
例如要把一组数据分成两个簇: > dataset = matrix(c(1,2,
+ 1.2,2,
+ 8,9,
+ 0.9,1.8,
+ 7,10,
+ 8.8,9.2), nrow=6, byrow=T)
> dataset
[,1] [,2]
[1,] 1.0 2.0
[2,] 1.2 2.0
[3,] 8.0 9.0
[4,] 0....
分类:
其他好文 时间:
2014-10-05 12:29:28
阅读次数:
221
Kaka's Matrix Travels
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 8006
Accepted: 3204
Description
On an N × N chessboard with a non-negative number i...
分类:
其他好文 时间:
2014-10-05 11:40:38
阅读次数:
281