摘要:
##算法描述 插值查找是二分查找的优化 适用条件:数据量大,待查找的数组是均匀分布的 下面是python代码 def insertValuesearch(a,targetValue): left = 0 right = len(a)-1 if targetValue>a[right] or targ 阅读全文
摘要:
问题:n*n的棋盘上放置n个皇后,使得n个皇后不能互相攻击(不能在同一行、同一列、同一对角线上) 思路(暴力):枚举1-n的全排列,判断每个全排列是否合法 #include<cstdio> #include<cstring> #include<algorithm> using namespace s 阅读全文