![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
文章平均质量分 76
lidiyang1993
这个作者很懒,什么都没留下…
展开
-
leetcode Binary Tree Postorder Traversal
Given a binary tree, return the postorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [3,2,1]. Note: Recursive solution原创 2015-04-06 14:12:48 · 288 阅读 · 0 评论 -
leetcode:N-queens
//解题思路:使用回溯法解决N皇后问题,是常见的解决方法。分N步放置皇后,由于皇后之间不能同行、同列、同斜线,所以每次放置皇后的时候,都要考虑是///否与已有的皇后“冲突”,如果冲突,则改变位置,直至所有皇后放置完毕。class Solution { public: vector > solveNQueens(int n) { vector pos_queen(n,-1);原创 2015-06-20 11:44:45 · 321 阅读 · 0 评论