高级编程技术作业
文章平均质量分 67
Schnee_Cy
个人网站 www.schnee.pro
展开
-
leetcode42.Trapping Rain Water
题目描述:class Solution: def trap(self, height): """ :type height: List[int] :rtype: int """ l, r, res, tmp = 0, len(height)-1, 0, 0 while l < r: ...原创 2018-04-24 20:26:21 · 166 阅读 · 0 评论 -
leetcode141. Linked List Cycle
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?# 快慢指针,若快指针能够与慢指针重合,则存在环# Definition for singly-linked list.# class ListNode(object):# ...原创 2018-05-04 08:56:16 · 145 阅读 · 0 评论 -
leetcode142. Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Note: Do not modify the linked list.Follow up:Can you solve it without using extra space?解题思路还是快慢指针,参考上图易...转载 2018-05-04 09:45:04 · 194 阅读 · 0 评论 -
Python Numpy 部分习题
Numpy 习题实战代码文件import numpy as npfrom scipy.linalg import toeplitzdef matAddMat(A): return A+Adef matMultMatT(A): return A*A.Tdef matTMuliMat(A): return A.T*Adef matMultmat(A, B):...原创 2018-05-19 16:20:13 · 508 阅读 · 0 评论 -
Python matplotlib 部分习题
这一次的作业必较难,涉及到挺多的新知识,需要查阅各类的官方文档,除此之外,我还参考了其他的一些技术博客import numpy as npimport matplotlib.pyplot as pltx = np.arange(0, 2, 0.01)y = np.sin((x-2)*(np.exp(-x**2)))**2plt.plot(x, y)plt.title("Exercis...原创 2018-05-28 10:47:06 · 752 阅读 · 0 评论 -
Python scipy 部分习题
import numpy as np from scipy.linalg import lstsq m = 80n = 40 A = np.random.normal(1, 2, (m, n)) b = np.random.normal(1, 2, (m, 1)) r_norm = lstsq(A, b)[1] print(r_norm) 输出:[203.8...原创 2018-06-04 12:44:07 · 302 阅读 · 0 评论 -
leetcode134. Gas Station
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its ne...原创 2018-04-30 16:36:53 · 197 阅读 · 0 评论 -
数据分析习题Python
本次作业是emu193教程的课后作业,来源自:https://nbviewer.jupyter.org/github/schmit/cme193-ipython-notebooks-lecture/blob/master/Exercises.ipynbPart 1For each of the four datasets...Compute the mean and variance of bot...原创 2018-06-11 18:28:29 · 2318 阅读 · 0 评论