算法学习
ひみつ
这个作者很懒,什么都没留下…
展开
-
面试算法题2——在大量重复数据中找到不重复数据
我的解法(Python3)def maxDepth(lis, repeat): if len(lis) == 2: if repeat == -1: return repeat return lis[0] if lis[0] != repeat else lis[1] if len(lis) == 1: ...原创 2019-10-26 10:13:39 · 476 阅读 · 0 评论 -
使用代码找到二元树的高度
提供代码class Node: # Constructor to create a new node def __init__(self, data): self.data = data self.left = None self.right = None我的解答def maxDepth(node): if node...原创 2019-10-26 10:10:01 · 135 阅读 · 0 评论 -
Codility Lesson - Lesson 4 - MissingInteger 我的GO语言算法
刚学GO语言,所以打算用go语言完成这个部分题目要求:Write a function:func Solution(A []int) intthat, given an array A of N integers, returns the smallest positiveinteger (greater than 0) that does not occur in A.For ex...原创 2019-06-12 23:08:39 · 453 阅读 · 0 评论 -
Codility - OddOccurrencesInArray
OddOccurrencesInArraypackage solution// you can also use imports, for example:// import "fmt"// import "os"import "sort"// you can write to stdout for debugging purposes, e.g.// fmt.Println("t...原创 2019-06-17 10:29:49 · 249 阅读 · 0 评论