摘要:
引用和指针的比较引用是C++中的概念,初学者容易把二者混淆。例1: int m; int &n = m; 在这里,n相当于是m的别名,对n的任何操作就是对m的操作。n既不是m的拷贝,也不是指向m的指针,其实n就是m它自己。例2: int i = 0; int j = 5; int &k = i; k... 阅读全文
摘要:
Contains Duplicate IIIGiven an array of integers, find out whether there are two distinct indicesiandjin the array such that the difference betweennum... 阅读全文
摘要:
Contains Duplicate IIGiven an array of integers and an integerk, find out whether there there are two distinct indicesiandjin the array such thatnums[... 阅读全文
摘要:
Contains DuplicateGiven an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at leas... 阅读全文