Hello_Motty

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2017年8月23日

摘要: c++中stl不是面向对象编程,而是提供一种新的方式:泛型编程。当然这个话题说起来几天几夜也说不完,然而如果对于stl有一个一般的理解,比如可以使用标准容器对数据进行存储,然后可以对标准容器进行简单的增删查改,知道stl中的大致algorithm,并且纠结于平时如何使用stl可以更加高效、易懂、安全 阅读全文
posted @ 2017-08-23 21:06 Hello_Motty 阅读(572) 评论(0) 推荐(1) 编辑

2017年8月22日

摘要: Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". 题意:翻转字符串,从头到尾翻转。 基本思路: 1.如果对 阅读全文
posted @ 2017-08-22 13:30 Hello_Motty 阅读(264) 评论(0) 推荐(0) 编辑

2017年8月21日

摘要: 题意:把一个矩阵变形成另一个矩阵,如3*4变成2*6。 基本思路: 1. 把矩阵中所有元素放在一个一维数组中,然后把一位数组中的数保存在新矩阵中。 2.1中思路并没有什么问题,但是用了多余的空间,实际上c语言中二维数组仍然是按行优先模式的一维数组保存的。而保存的时候只需要将行数读出来保存在新数组中。 阅读全文
posted @ 2017-08-21 14:50 Hello_Motty 阅读(165) 评论(0) 推荐(0) 编辑

2017年8月19日

摘要: Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of th 阅读全文
posted @ 2017-08-19 22:04 Hello_Motty 阅读(138) 评论(0) 推荐(0) 编辑

2017年8月18日

摘要: Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. E 阅读全文
posted @ 2017-08-18 20:48 Hello_Motty 阅读(189) 评论(0) 推荐(0) 编辑

2017年8月14日

摘要: Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. 题意:给一 阅读全文
posted @ 2017-08-14 21:36 Hello_Motty 阅读(123) 评论(0) 推荐(0) 编辑

2017年8月12日

摘要: Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: Example 1: Exa 阅读全文
posted @ 2017-08-12 21:55 Hello_Motty 阅读(159) 评论(0) 推荐(0) 编辑

2017年8月11日

摘要: Given a table salary, such as the one below, that has m=male and f=female values. Swap all f and m values (i.e., change all f values to m and vice ver 阅读全文
posted @ 2017-08-11 23:09 Hello_Motty 阅读(422) 评论(0) 推荐(0) 编辑

2017年8月10日

摘要: Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are n 阅读全文
posted @ 2017-08-10 22:02 Hello_Motty 阅读(241) 评论(0) 推荐(0) 编辑

2017年8月9日

摘要: There is a table World A country is big if it has an area of bigger than 3 million square km or a population of more than 25 million. Write a SQL solu 阅读全文
posted @ 2017-08-09 21:59 Hello_Motty 阅读(374) 评论(0) 推荐(0) 编辑