• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
qianye0905
博客园    首页    新随笔    联系   管理    订阅  订阅
2013年9月12日
vector排序问题<unresolved overloaded function type>
摘要: 要对vector中的自定义类型进行排序,首先需要提供一个函数bool comp(const Interval & a, const Interval & b)来定义类型的排序准则然后调用std::sort(intervals.begin(),intervals.end(),comp) 写了几个小的测试用例也都通过了,但是当集成在类中的时候编译遇到问题,Line 30: no matching function for call to 'sort(std::vector::iterator, std::vector::iterator, )'刚开始以为是类型不对, 阅读全文
posted @ 2013-09-12 02:28 qianye0905 阅读(8005) 评论(0) 推荐(1)
Spiral Matrix
摘要: Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]You should return[1,2,3,6,9,8,7,4,5].这道打印矩阵的题以前遇到很多次,但写代码的时候还是有很多种情况没有考虑到,导致花费挺多时间。题意:给定一个m*n的矩阵,从外围一层一层的打印出矩阵中的数据思路:使用两个结点分 阅读全文
posted @ 2013-09-12 00:29 qianye0905 阅读(1267) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3