摘要:
c++中stl不是面向对象编程,而是提供一种新的方式:泛型编程。当然这个话题说起来几天几夜也说不完,然而如果对于stl有一个一般的理解,比如可以使用标准容器对数据进行存储,然后可以对标准容器进行简单的增删查改,知道stl中的大致algorithm,并且纠结于平时如何使用stl可以更加高效、易懂、安全 阅读全文
摘要:
Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". 题意:翻转字符串,从头到尾翻转。 基本思路: 1.如果对 阅读全文
摘要:
题意:把一个矩阵变形成另一个矩阵,如3*4变成2*6。 基本思路: 1. 把矩阵中所有元素放在一个一维数组中,然后把一位数组中的数保存在新矩阵中。 2.1中思路并没有什么问题,但是用了多余的空间,实际上c语言中二维数组仍然是按行优先模式的一维数组保存的。而保存的时候只需要将行数读出来保存在新数组中。 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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. 题意:给一 阅读全文
摘要:
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: Example 1: Exa 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文