08 2017 档案
摘要:题目地址:http://coursera.cs.princeton.edu/algs4/assignments/kdtree.html 分析: Brute-force implementation. 蛮力实现的方法比较简单,就是逐个遍历每个point进行比较,实现下述API就可以了,没有什么难度。
阅读全文
摘要:题目原文: Design an algorithm to perform an inorder traversal of a binary search tree using only a constant amount of extra space. 1 public void traverse(
阅读全文
摘要:题目原文: Given a binary tree where each 𝙽𝚘𝚍𝚎 contains a key, determine whether it is a binary search tree. Use extra space proportional to the height
阅读全文
摘要:树还是应该做成可视化的方便查看和调试,后续我将更新一个可视化的生成图的版本出来,恩,一定要记得这件事
阅读全文
摘要:1. Java autoboxing and equals(). Consider two double values a and b and their corresponding Double value x and y. Find values such that (𝚊==𝚋) is 𝚝
阅读全文
摘要:题目原文:http://coursera.cs.princeton.edu/algs4/assignments/8puzzle.html 题目要求:设计一个程序解决8 puzzle问题以及该问题的推广,例如8-puzzle是3*3,程序要能解决n*n的同类问题(2 ≤ n < 128) 典型的8 p
阅读全文
摘要:题目原文: Decimal dominants. Given an array with n keys, design an algorithm to find all values that occur more than n/10 times. The expected running time
阅读全文
摘要:题目原文 Selection in two sorted arrays. Given two sorted arrays a[] and b[], of sizes n1 and n2, respectively, design an algorithm to find the kth larges
阅读全文

浙公网安备 33010602011771号