zoukankan      html  css  js  c++  java
  • 653. Two Sum IV

    /**
     * Definition for a binary tree node.
     * struct TreeNode {
     *     int val;
     *     TreeNode *left;
     *     TreeNode *right;
     *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}
     * };
     */
    class Solution {
    public:
        unordered_set<int> s;
        bool findTarget(TreeNode* root, int k) {
            if (root == NULL)   return false;
            if (s.find(k - root->val) != s.end()) return true;
            s.insert(root->val);
            return findTarget(root->left, k) || findTarget(root->right, k);
        }
    };
  • 相关阅读:
    UVA
    UVA
    UVA
    UVA
    UVA
    UVA
    UVA
    UVA
    UVA
    使用Jmeter(三十)针对ActiveMQ JMS POINT TO POINT压力测试(转载)
  • 原文地址:https://www.cnblogs.com/JTechRoad/p/9121275.html
Copyright © 2011-2022 走看看