上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 16 下一页
摘要: Sort a linked list using insertion sort. 复杂度 o(n^2); 插入排序 (Insertion Sort) 设有一组关键字{K1, K2,…, Kn};排序开始就认为 K1 是一个有序序列;让 K2 插入上述表长为 1 的有序序列,使之成为一个表长为 2 的 阅读全文
posted @ 2016-10-29 03:41 微微程序媛 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j]and the d 阅读全文
posted @ 2016-10-26 08:37 微微程序媛 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmet 阅读全文
posted @ 2016-10-26 06:45 微微程序媛 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 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 a 阅读全文
posted @ 2016-10-26 05:47 微微程序媛 阅读(123) 评论(0) 推荐(0) 编辑
摘要: import java.util.*; class Node{ String val; Set children = new HashSet(); // at most 15 children; public Node(String val){ this.val = val; this.children = new HashSet(); ... 阅读全文
posted @ 2016-10-26 04:01 微微程序媛 阅读(257) 评论(0) 推荐(0) 编辑
摘要: Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get the 阅读全文
posted @ 2016-10-26 03:57 微微程序媛 阅读(555) 评论(0) 推荐(0) 编辑
摘要: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. 阅读全文
posted @ 2016-10-26 00:42 微微程序媛 阅读(151) 评论(0) 推荐(0) 编辑
摘要: You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee 阅读全文
posted @ 2016-10-26 00:20 微微程序媛 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 阅读全文
posted @ 2016-10-24 07:36 微微程序媛 阅读(138) 评论(0) 推荐(0) 编辑
摘要: A message containing letters from A-Z is being encoded to numbers using the following mapping: Given an encoded message containing digits, determine t 阅读全文
posted @ 2016-10-24 05:29 微微程序媛 阅读(132) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 16 下一页