摘要: 1 import numpy as np 2 3 def loadDataSet(): 4 postingList = [["my","dog","has","flea", 5 "problems","help","please"], 6 ["maybe","not","take","him", ... 阅读全文
posted @ 2017-10-26 16:47 __迷途的羔羊 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 1 #include"stdio.h" 2 int main() 3 { 4 int a[1001]; 5 int count = 0,frontCount; 6 int n,i,result; 7 int max = 0; 8 scanf("%d",&n); 9 for(i=0;i max) 29 max... 阅读全文
posted @ 2017-10-25 13:24 __迷途的羔羊 阅读(262) 评论(0) 推荐(0) 编辑
摘要: 题目:在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序,请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否包含了该整数。 例:下面的二维数组就是每行、每列都按递增排序。如果在这个数组中查找数字6,则返回true(找得到);如果查找数字5,由于数组 阅读全文
posted @ 2017-10-25 12:44 __迷途的羔羊 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 1 #include"stdio.h" 2 int findMaxCrossingSubarray(int a[],int low,int high); 3 int findMaximumSubarray(int a[],int low,int high); 4 int maxLeft,maxRight; 5 int main() 6 { 7 int a[100] = {0... 阅读全文
posted @ 2017-10-24 19:16 __迷途的羔羊 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 1 from math import log 2 import operator 3 4 def createDataSet(): 5 dataSet = [[1,1,"yes"], 6 [1,1,"yes"], 7 [1,0,"no"], 8 [0,1,"no"], 9 ... 阅读全文
posted @ 2017-10-23 18:13 __迷途的羔羊 阅读(215) 评论(0) 推荐(0) 编辑