Posts Tagged ‘Data Structure’

std::vector

Posted: October 17, 2011 in C/C++, Programming
Tags: , ,

vector, in C++ can act as a ArrayList,  similar to Java or C#. vector itself is included as a part of STL. In this article i just introduce some basic usage of vector, the rest can read here. Here’s the instantiation of vector: To add a member, we can use push_back() vector’s size it very [...]

Bubble sort is a simple sorting algorithm. It works by repeatedly stepping through the list to be sorted, comparing two items at a time and swapping them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted. The algorithm [...]