随笔分类 - LeeCode
摘要:Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr...
        阅读全文
                
摘要:Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1 1 /** 2 * Definition for a binary tre...
        阅读全文
                
摘要:Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr...
        阅读全文
                
摘要:Given a linked list, determine if it has a cycle in it. 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ...
        阅读全文
                
摘要:Write a function that takes an unsigned integer and returns the number of ’1' bits it hasFor example, the 32-bit integer ’11' has binary representatio...
        阅读全文
                
摘要:Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is1 -> 2 -> 3 -> ...
        阅读全文
                
摘要:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical an...
        阅读全文
                
摘要:Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ...
        阅读全文
                

 浙公网安备 33010602011771号
浙公网安备 33010602011771号