摘要: 很多笔试题都会问中序表达式转换成后缀表达式的方法 算法很固定,需要用到两个栈 想将表达式字符串转换成tokens,然后在从左向右遍历整个数组。 def reverse_polish_notation(expression:str): op_stack = [] digit_stack = [] ex 阅读全文
posted @ 2020-03-09 20:31 AcodingDog 阅读(284) 评论(0) 推荐(0)
摘要: 问题: https://leetcode-cn.com/problems/edit-distance/ 讨论: 这个题我在华为笔试的时候遇到过,直接看懵了。无意中在知乎上发现有人讨论这个题(https://zhuanlan.zhihu.com/p/111409982),稍微弄懂了些皮毛, 所以记录一 阅读全文
posted @ 2020-03-09 12:44 AcodingDog 阅读(288) 评论(0) 推荐(0)