随笔分类 -  算法学习

LeetCode: 104. Maximum Depth of Binary Tree-简单-Python+Java
摘要:Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l 阅读全文

posted @ 2019-09-16 11:19 cherryjing0629 阅读(136) 评论(0) 推荐(0)

LeetCode: 344. Reverse String-简单-Python+Java
摘要:344. Reverse String Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space f 阅读全文

posted @ 2019-09-16 11:03 cherryjing0629 阅读(147) 评论(0) 推荐(0)

用bisect模块解答二分算法题
摘要:1.bisect模块介绍 bisect模块包括两个主要函数 bisect和insort 这两个函数都用二分查找算法来在有序序列中查找或者插入元素,在插入这个元素后,原来的序列还能保持升序 bisect/ bisect_left / bisect_right 返回该元素插入的index insort/ 阅读全文

posted @ 2018-11-16 14:58 cherryjing0629 阅读(199) 评论(0) 推荐(1)

导航