Algorithm Day1
来源:互联网 发布:编程是什么 编辑:程序博客网 时间:2024/06/07 03:27
Algorithm Day 1
- To get understand the impact of algorithm.
- Know about the problem of “Dynamic connectivity”
Learned there are three ways to solve this problem:
- Quick find, Quick Union,
- Weighted Quick union,
- Weighted Quick union with path compression
Steps to developing a usable algorithm
- Model the problem.
- Find an algorithm to solve it.
- Fast enough? Fits in memory?
- If not, figure out why.
- Find a way to address the problem.
- Iterate until satisfied.
The scientific method.
Mathematical analysis.
Q1: So, How to solve the Kruskal’s minimum spanning tree with union-find ?
Q2: Social network connectivity. Given a social network containing n members and a log file containing m timestamps at which times pairs of members formed friendships, design an algorithm to determine the earliest time at which all members are connected (i.e., every member is a friend of a friend of a friend … of a friend). Assume that the log file is sorted by timestamp and that friendship is an equivalence relation. The running time of your algorithm should be m*log n or better and use extra space proportional to n.
Q3: Search in a bitonic array. An array is bitonic if it is comprised of an increasing sequence of integers followed immediately by a decreasing sequence of integers. Write a program that, given a bitonic array of n distinct integer values, determines whether a given integer is in the array.
- Standard version: Use ∼3lgn compares in the worst case.
- Signing bonus: Use ∼2lgn compares in the worst case (and prove that no algorithm can guarantee to perform fewer than ∼2lgn compares in the worst case).
阅读全文
0 0
- Algorithm Day1
- Day1
- day1
- day1
- day1
- day1
- day1
- day1
- Day1
- DAY1
- day1
- day1
- day1
- Day1
- day1
- day1
- Day1
- Day1
- [JZSC2017]【NOIP2017提高组模拟7.4】总结
- Unity帧动画
- ajax后台返回的数据为空前台显示出现undefined的解决方法
- Cesium学习(1):简介
- grep的用法
- Algorithm Day1
- UVa 11297 Census 二维线段树模板
- jquery常用技巧及常用方法列表集合
- 解决listview里面edittext焦点问题
- 手机设计公司最基本的六个部门:ID、MD、HW、SW、PM、Sourcing、QA
- 网络舆情安全体系的重要特性
- python-优矿-期权合成策略分析
- Android屏幕适配全攻略
- 用例建模的步骤