当前搜索:

【LeetCode从零单排】No133. clon graph (BFS广度优先搜索)

背景(以下背景资料转载自:http://www.cnblogs.com/springfor/p/3874591.html?utm_source=tuicool)DFS(Dpeth-first Search)顾名思义,就是深度搜索,一条路走到黑,再选新的路。记得上Algorithm的时候,教授举得例...
阅读(1446) 评论(0)

【LeetCode从零单排】No121 Best Time to Buy and Sell Stock

题目Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transacti...
阅读(1260) 评论(0)

单链表问题(反转、是否有环、删除结尾第N个节点、合并两个sortlist、找到交点)

1.时间复杂度O(N),内存O(1)的效率下实现单链表的翻转public static TreeNode revers(TreeNode head){ TreeNode temp,first,second; first=head; second=head.next; while(...
阅读(1598) 评论(0)

【LeetCode从零单排】No96 Unique Binary Search Trees

题目Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BS...
阅读(1315) 评论(0)

【LeetCode从零单排】No129 Sum Root to Leaf Numbers

题目Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2-&g...
阅读(1020) 评论(0)

【LeetCode从零单排】No15 3Sum

题目Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum ...
阅读(935) 评论(0)

【LeetCode从零单排】No 3 Longest Substring Without Repeating Characters

题目Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters...
阅读(1157) 评论(0)

【LeetCode从零单排】No 114 Flatten Binary Tree to Linked List

题目Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6 The fla...
阅读(1128) 评论(0)

【LeetCode从零单排】No 191.Number of 1 Bits(考察位运算)

题目Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bi...
阅读(4217) 评论(2)

【LeetCode从零单排】No189 .Rotate Array

题目Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].No...
阅读(1207) 评论(0)

【LeetCode从零单排】No.169 Majority Element(hashmap用法)

题目Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that t...
阅读(1223) 评论(0)

【LeetCode从零单排】No.160 Intersection of Two Linked Lists

题目Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: ...
阅读(1069) 评论(0)

【LeetCode从零单排】No118 Pascal's Triangle

题目Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1],...
阅读(1219) 评论(0)

【LeetCode从零单排】No112 Path Sum

题目Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum...
阅读(1341) 评论(0)

【LeetCode从零单排】No104 Maximum Depth of Binary Tree

题目Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest...
阅读(1231) 评论(0)

【LeetCode从零单排】No102 Binary Tree Level Order Traversal

题目       Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binar...
阅读(1260) 评论(2)

【LeetCode从零单排】No100 Same Tree && No101 Symmetric Tree

题目1.same treeGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurall...
阅读(1177) 评论(0)

【LeetCode从零单排】No83 Remove Duplicates from Sorted List

题目Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1-&...
阅读(1124) 评论(0)

【LeetCode从零单排】No88.Merge Sorted Array

题目Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or eq...
阅读(1079) 评论(0)

【LeetCode从零单排】No70.ClimbingStairs

题目          爬楼梯问题,这是一道很有趣的问题。首先看题目:You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. I...
阅读(1720) 评论(0)
    统计

    主要讲述算法和业务的结合,适合初学者

    机器学习实践应用

    京东地址

    作者公众号:凡人机器学习

    凡人机器学习

    个人资料
    专栏达人 持之以恒
    等级:
    访问量: 89万+
    积分: 1万+
    排名: 1619
    博客专栏