上一页 1 2 3 4 5 6 7 8 9 ··· 13 下一页
摘要: count()函数有两种使用方式: 1.使用count(*)对表中行的数目进行计数,不管表列中包含的是否空值(NULL)还是非空值。 2.使用count(columns)对特定列中具有值的行进行计数,忽略NULL值; 阅读全文
posted @ 2020-10-27 21:06 诗和远方* 阅读(821) 评论(0) 推荐(0) 编辑
摘要: 参考博文链接:https://blog.csdn.net/qq_28584889/article/details/88136498 当基准数选择最左边的数字时,那么就应该先从右边开始搜索;当基准数选择最右边的数字时,那么就应该先从左边开始搜索。不论是从小到大排序还是从大到小排序!快速排序之所比较快, 阅读全文
posted @ 2020-10-23 10:13 诗和远方* 阅读(960) 评论(0) 推荐(0) 编辑
摘要: 代码: #include<iostream>#include<stack> using namespace std; class ListNode{public: int m_nKey; ListNode* m_pNext; ListNode(int data):m_pNext(nullptr){ 阅读全文
posted @ 2020-10-06 09:41 诗和远方* 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 代码: #include<iostream> using namespace std; class listnode{public: int m_nValue; listnode* m_pNext; listnode(int data):m_pNext(nullptr){ this->m_nValu 阅读全文
posted @ 2020-10-06 01:19 诗和远方* 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 原文链接:https://www.cnblogs.com/inception6-lxc/p/8996050.html 在看书的时候有个往链表里添加节点的函数,代码中考虑到可能给出的头指针为空,并做另外一些处理。具体代码如下: [cpp] view plain copy print? #include 阅读全文
posted @ 2020-10-05 21:02 诗和远方* 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 代码: #include<iostream>#include<string> using namespace std; class Solution{public: string ReplaceBlank(string s) { int count=0; int len = s.size(); fo 阅读全文
posted @ 2020-10-05 01:25 诗和远方* 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 相当于C++的:for( int i = 0; i < s.length(); i++){ s[i]....} 使用 for (char c : s) 时会复制一个s字符串再进行遍历操作,而使用 for (char& c : s) 时直接引用原字符串进行遍历操作,由于复制一个字符串花费了大量的时间, 阅读全文
posted @ 2020-10-04 23:54 诗和远方* 阅读(3350) 评论(0) 推荐(0) 编辑
摘要: 代码和测试用例: #include<iostream>#include<vector> using namespace std; class Soluction{public: bool findNumberIn2DArray(vector<vector<int>>&matrix,int targe 阅读全文
posted @ 2020-10-04 11:33 诗和远方* 阅读(155) 评论(0) 推荐(0) 编辑
摘要: boolalpha是头文件#include <iostream>中的一个函数,是把bool test = 1; 变量打印出false或者true的函数 实例: 阅读全文
posted @ 2020-10-04 10:46 诗和远方* 阅读(367) 评论(0) 推荐(0) 编辑
摘要: 确切的含义如下。在C++中没有真正的2D矢量,但有std::vector<T>包含std::vector<T>。 如果你声明一个载体std::vector<int> vec(10)你有一个包含10个元素的向量。所以vec.size()是10. 如果你声明std::vector<std::vector 阅读全文
posted @ 2020-10-04 08:59 诗和远方* 阅读(2409) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 13 下一页