コード例 #1
0
ファイル: Source.cpp プロジェクト: Komdosh/ELTECHLabWorks
void getInf(const HT& T, char name)
{
	if (!T.empty()) {
		unsigned n = T.bucket_count();
		for (unsigned i = 0; i<n; ++i) {
			cout << "A[" << i << "]: ";
			for (auto it = T.cbegin(i); it != T.cend(i); ++it)
				cout << "{" << it->first << ":" << it->second << "} ";
			cout << "\n";
		}
	}
	else
		cout << "Хеш-таблица " << name << " пустая";
	cout << endl;
}
コード例 #2
0
 /** Get the number of allocated buckets.
  *  This corresponds to the max_size() value.
  *  @return the number of buckets
  *  @see max_size
  */
 size_type bucket_count() const { return m_ht.bucket_count(); }