自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(22)
  • 收藏
  • 关注

原创 [leetcode] 30. Substring with Concatenation of All Words

题意给定字符串s和单词集合words,words里面的所有word以任意顺序组合成一个新的字符串t,其中要求每个word出现且仅出现1次,问在组合字符串t是否是s的字串,若是,求出t在s开始的下标,题目要求求出所有满足要求的下标。题解window slide代码static int x=[](){ std::ios::sync_with_stdio(false); cin...

2019-08-25 16:48:45 100

原创 [leetcode] 25. Reverse Nodes in k-Group

题意如例子所示,给定一个链表,以k个元素作为一组,将它们倒置,若剩余不足k个,保持不变。Given this linked list: 1->2->3->4->5For k = 2, you should return: 2->1->4->3->5For k = 3, you should return: 3->2->1->...

2019-04-13 20:24:08 115

原创 sklearn习题

高级编程技术sklearn习题题目: 代码:#!/usr/bin/env python# -*- coding: utf-8 -*- import sklearn.datasets as sdimport sklearn.metrics as smimport sklearn.model_selection as smsimport sklearn.naive_...

2018-06-19 19:21:27 269

原创 [高级编程技术] 第十四周

Part1For each of the four datasets…Compute the mean and variance of both x and yCompute the correlation coefficient between x and yCompute the linear regression line: y=β0+β1x+ϵ (hint: u...

2018-06-13 13:34:28 211

原创 [Scipy课后习题]

Scipy课后习题Exercise 10.1: Least squaresGenerate matrix A ∈ Rm×n with m > n. Also generate some vector b ∈ Rm. Now find x = argminxkAx−bk2. Print the norm of the residual.from scipy import ...

2018-06-04 21:44:42 332

原创 [Matplotlib课后练习]

Exercise 11.1: Plotting a functionPlot the functionf(x) = sin2(x−2)e−x2 over the interval [0,2].Add proper axis labels, a title, etc.import matplotlib.pyplot as pltimport numpy as npx = np.l...

2018-05-27 22:57:31 240

原创 Numpy课后习题

Numpy课后习题Generate matrices A, with random Gaussian entries, B, a Toeplitz matrix,where A ∈Rn×m and B ∈Rm×m, for n = 200, m = 500. 由于n = 200, m = 500过大,难以显示,使用n = 10, m = 15替代1.类的创建和初始化,创建矩阵A、B,...

2018-05-22 19:19:13 477

原创 [leetcode] 65. Valid Number

[leetcode] 11. Container With Most Water题目:validate if a given string is numeric. Some examples: "0" => true " 0.1 " => true "abc" => false "1 a" => false "2e10" =&am

2018-05-02 20:43:38 159

原创 [leetcode] 11. Container With Most Water

[leetcode] 11. Container With Most Water题目:Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints ...

2018-04-30 21:12:26 157

原创 [leetcode] 23. Merge k Sorted Lists

[leetcode] 23. Merge k Sorted ListsMerge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.Example:Input:[ 1->4->5, 1->3->4, 2-...

2018-04-28 00:33:04 140

原创 [leetcode][array] 42. Trapping Rain Water

[leetcode]42. Trapping Rain WaterGiven n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.The above...

2018-04-28 00:00:30 254

原创 高级编程技术第六周平时作业

高级编程技术第六周平时作业10-11 喜欢的数字:First program:import jsonfilename = 'number.json'number = input("Input your favorite integer number: ")try: number = int(number)except ValueError: prin...

2018-04-10 13:00:41 227

原创 高级编程技术第五周平时作业(2)

高级编程技术第五周平时作业(2)10-1 Python 学习笔记in learning_python.txt:In Python you can say hello world.In Python you can calculate 1 + 1.In Python you can do everything.in main.py:file_name = 'learning_...

2018-04-08 20:03:26 166

原创 高级编程技术第五周作业

高级编程技术第五周作业9-1 餐馆:class Restaurant(): def __init__(self, restaurant_name, cuisine_type): self.restaurant_name = restaurant_name self.cuisine_type = cuisine_type def descr...

2018-04-02 16:56:22 178

原创 高级编程技术第四周平时作业(2)

高级编程技术第四周平时作业(2)8-1 消息:def display_message(): """打印本章学什么""" print("本章学的是函数。")display_message()8-2 喜欢的图书:def favorite_book(title): print("One of my favorite books is " + title)f...

2018-04-02 00:36:50 161

原创 高级编程技术第四周平时作业

高级编程技术第四周平时作业7-3 10的整数倍:number = input("输入一个数字:")number = int(number)if number % 10 == 0: print("这是10的整数倍")else: print("这不是10的整数倍")7-5 电影票:msg = "请输入你的年龄,我会告诉你对应的电影票价,或者输入'quiz'退出...

2018-04-01 23:51:53 226

原创 高级编程技术第三周平时作业(2)

高级编程技术第三周平时作业(2)6-1 人:information = { 'first_name': 'Guo', 'last_name': 'Kiko', 'age': 20, 'city': 'Shandong',}print(information['first_name'] + ' ' + information['last_name'...

2018-03-21 21:07:19 186

原创 高级编程技术第三周平时作业

高级编程技术第三周平时作业5-2 更多条件测试:print('dog' == 'cat')print('dog' == 'dog')print()print('Dog' == 'dog')print('Dog'.lower() == 'dog')print()print(11 == 11)print(11 != 11)print(12 > 11)print(...

2018-03-21 21:07:00 203

原创 高级编程技术第二周平时作业(2)

高级编程技术第二周平时作业(2)4-1 披萨:pizzas = ['Seafood pizza', 'Sausage pizza', 'Cheese pizza']for pizza in pizzas: print(pizza)for pizza in pizzas: print('I like ' + pizza)4-3 数到20:for i in ra...

2018-03-14 19:43:32 198

原创 高级编程技术第二周平时作业

高级编程技术第二周平时作业3-1 姓名:将一些朋友的名字存储在一个列表中,并将其命名为names。依次访问该列表中的每个元素,从而将朋友的姓名都打印出来。names = ['Tom', 'Jerry', 'Mary']print(names[0])print(names[1])print(names[2])3-2 问候语:继续使用3-1的列表,为每个人打印一条信息。抬...

2018-03-12 23:20:46 333

原创 高级编程技术第一周平时作业(2)

高级编程技术第一周平时作业(2)2-2 多条简单信息:将一条信息存储到变量中,将其打印出来;再将变量的值修改为一条新信息,并将其打印出来。>>> message = “Hello, everyone!”>>> print(message)Hello, everyone!>>> message = “Hi, Tom!”&gt...

2018-03-08 22:14:52 459

原创 高级编程技术第一周平时作业

高级编程技术第一周平时作业1、浏览Python主页(https://www.python.org/)的发现和收获在Python的主页上,一个亮眼的地方在于它有一个模块介绍了某些Python的语法和特点,并附有着代码,在上面可以有个按钮转到Python的Online console进行在线运行Python。 文档:在Python的主页上除了基本的安装程序,上面还附有Python的文...

2018-03-07 19:15:21 321

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除