上一页 1 2 3 4 5 6 7 8 9 10 ··· 26 下一页
摘要: Problem LeetCode Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the 阅读全文
posted @ 2021-01-07 21:08 Wonz 阅读(72) 评论(0) 推荐(0) 编辑
摘要: Problem LeetCode Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Example 1: Input: root = [3,1,4,null 阅读全文
posted @ 2021-01-07 20:54 Wonz 阅读(79) 评论(0) 推荐(0) 编辑
摘要: Problem LeetCode Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: The root is the maximum number 阅读全文
posted @ 2021-01-06 22:46 Wonz 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Problem LeetCode Given a binary tree, flatten it to a linked list in-place. For example, given the following tree: 1 / \ 2 5 / \ \ 3 4 6 The flattened 阅读全文
posted @ 2021-01-06 21:39 Wonz 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Problem LeetCode You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has th 阅读全文
posted @ 2021-01-06 21:05 Wonz 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 写在前面 2019.12.21-12.22,我参加了 2020 全国硕士研究生招生考试初试。后来的结果算是意料之中,没考上,经过自己的一番思考之后,毅然决定毕业后直接工作。在参加 2020 年春招的时候,我写下了一篇文章:我选择直接工作,不读研。 现在是 2020 年 12 月,快接近 2020 年 阅读全文
posted @ 2020-12-30 23:11 Wonz 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 一、问题 因为前文提到工作中需要使用 Go 调 Python 脚本执行加解密,但是 Go 那边执行命令行输出的是 str 类型。因此需要转回 bytes 进行解密,但是发现转回 bytes 和原来的不一样。下面以一个小例子做演示。 old_bytes = b"=\x1di\xab\xc1~)]9H\ 阅读全文
posted @ 2020-12-23 22:47 Wonz 阅读(1210) 评论(1) 推荐(0) 编辑
摘要: 一、场景 工作中的一个场景:Go 需要对信息加解密,但是研究了 GmSSL Go API 文档之后,发现是依赖于 CGO 的,同事配了半天环境没配成功。于是换了一个方法,选择 Go 调 Python 脚本执行加解密。之前我是写过 Python 对信息使用国密 sm2 算法进行加解密的,因此比较方便。 阅读全文
posted @ 2020-12-23 22:40 Wonz 阅读(6622) 评论(2) 推荐(0) 编辑
摘要: 一、模板引擎 1. 模板中绑定基本数据、字符串、数值、布尔值 default.go: package controllers import ( "github.com/astaxie/beego" ) type MainController struct { beego.Controller } f 阅读全文
posted @ 2020-12-16 22:23 Wonz 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 一、动态路由 api.go: package controllers import ( "github.com/astaxie/beego" ) type ApiController struct { beego.Controller } // http://localhost:8080/api/1 阅读全文
posted @ 2020-12-16 22:18 Wonz 阅读(255) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 26 下一页