- 博客(18)
- 资源 (9)
- 收藏
- 关注
原创 [leetcode] Search in Rotated Sorted Array Python
Problem: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 t
2014-05-20 10:32:12 1781
原创 [leetcode] python Remove Duplicates from Sorted Array II
problem:Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array A = [1,1,1,2,2,3],Your function should return length = 5, and A
2014-05-20 08:38:43 1746
原创 [leetcode]Reverse Words in a String
problem:Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".solution:
2014-05-17 22:18:04 653
原创 [leetcode] Remove Duplicates from Sorted Array python
leetcodeGiven a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must d
2014-05-17 22:14:16 904
原创 C语言练习-2转义字符
#include int main(){ printf("how are u?\n");// 回车 printf("i am fine.\n\n"); printf("how are u? \t");//下一个输出区 printf("i am fine.\n\n"); printf("how are u \n");//光标左移一位开始输出 p
2014-05-16 17:30:58 1524
原创 C语言练习-1类型转换
#include int main(){ int a = 5; char c = 'a'; float f = 5.3; double m = 12.65; double result; printf("a + c = %d\n", a+c); // 102 printf("a + c = %c\n", a+c); // f p
2014-05-16 17:11:52 1179
转载 count_inversions in an integer list
count = 0def merge_sort(li): if len(li) < 2: return li m = len(li) / 2 return merge(merge_sort(li[:m]), merge_sort(li[m:])) def merge(l, r): global count result = [] i
2014-05-14 13:14:31 844
原创 abacus
########################################################################## 10-row School abacus# by# Michael H#########################
2014-05-09 16:14:18 1248
转载 RK4
MODULE Global_data !Symbolic names for kind types of single- and double-precision reals: INTEGER, PARAMETER :: SP = KIND(1.0) INTEGER, PARAMETER :: DP = KIND(1.0D0) !Frequently used mathematical const
2014-05-09 16:11:05 1478 2
转载 SOR
MODULE Global_data !Symbolic names for kind types of single- and double-precision reals: INTEGER, PARAMETER :: SP = KIND(1.0) INTEGER, PARAMETER :: DP = KIND(1.0D0) !Frequently used mathema
2014-05-09 16:06:15 935
原创 check_sudoku
# Define a procedure, check_sudoku,# that takes as input a square list# of lists representing an n x n# sudoku puzzle solution and returns the boolean# True if the input is a valid# sudoku square
2014-05-09 16:01:34 633
原创 mergesort in python
def mergesort(List): """ input : List, an integer list output : an sorted integer list """ n = len(List) if n == 0 or n==1: return List first = mergesort(List[:n/2]
2014-05-04 21:47:27 918
原创 double_linked_list in Python
# -*- coding: utf-8 -*-class Frob(object): def __init__(self, name): self.name = name self.before = None self.after = None def setBefore(self, before): # examp
2014-05-01 21:33:48 2863
原创 Example: solving ODE using FEM method
clc;clear;% find the solution of du/dt -1 =0 Using finite element method% the zone of solution is [0,1]E = 5; % the number of elementsN = E+1; % the number of nodes%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2014-05-01 21:08:26 783
A simple adaptive first-order differential microphone.pd
2018-04-08
email data for naive bayes filter
2017-01-15
Ian Goodfellow introduction to GANs ( Generative Adversarial Networks)
2016-12-09
HangMan 猜单词 一个简易的吊死鬼游戏 python版
2016-03-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人