- 建议给自己制定一个计划,计划应该细致一些,细致到这一周的目标最好,太细不好,因为工程师会被新技术,新方向给吸引,因此给自己留足溜号的时间
- 不要排斥新东西,新技术
- 思考问题要有深度(这一点自己做的不好)
这里按照自己熟悉和了解的领域进行编写,大家轻轻拍砖😄
- 除了学习先修课程,其中推荐一些课程
#!/usr/bin/env python
# coding=utf-8
import os
import pandas as pd
saveDir = "/home/fighter/imageretrievedata/for_train/"
def deal_cluster(filePaths):
#include <iostream>
#include <vector>
using namespace std;
const int NodeMax = 26;
typedef struct _TrieNode {
int cnt;
struct _TrieNode* next[NodeMax];
对于一个单链表,我们假设这样一种情况,我们不知道单链表的头节点,我们只是知道单链表中某一个节点的指针,现在我们想删除这个节点,我们如何做到?
在我做leetcode是遇到这样的一个问题,设计一个数据结构,实现插入、删除、随机获取一个数据的均需要咋O(1)的时间完成。
class RandomizedSet {
public:
/** Initialize your data structure here. */
Internally, the elements in the unordered_map are not sorted in any particular order with respect to either their key or mapped values, but organized into buckets depending on their hash values to allow for fast access to individual elements directly by their key values (with a constant average time complexity on average).
unordered_map containers are faster than map containers to access individual elements by their key, although they are generally less efficient for range iteration through a subset of their elements.
这段英文按我的理解就是unordered_map的快速插入和快速查找都是没有问题的,只不过对于迭代器遍历的速度恐怕会相比低效一些。
priority_queue<Type, Container, Functional>
Type - 数据类型
Container - 保存数据的容器
Functional - 用来指定数据之间的比较规则
STL中的默认的priority_queue是存储类型为vector的大顶堆,使用方式如下
priority_queue<int, vector<int>, less<int>> high_heap;
void doSomething() {
vector<Widget*> vwp;
for(int i=0;i<NUMS;++i) {
vwp.push_back(new Widget);
}
}
// Widgets are leaked here !
class Widget { ... };
vector<Widget> vw;
Widget bestWidget;
vector<Widget>::iterator it =find(vw.begin(), vw.end(), bestWidget);
you should write this