vector实现十字链表管理不规则数据

vector实现十字链表管理不规则数据
#include<iostream>
#include<vector>
using std::vector ;

void main(){
       vector< int> myvector1;
       myvector1.push_back(12);
       myvector1.push_back(13);
       myvector1.push_back(13);
       myvector1.push_back(13);
       myvector1.push_back(14);
       vector< int> myvector2;
       myvector2.push_back(22);
       myvector1.push_back(13);
       myvector1.push_back(13);
       myvector2.push_back(23);
       myvector2.push_back(24);
       vector< int> myvector3;
       myvector3.push_back(32);
       myvector3.push_back(32);
       myvector3.push_back(32);
       myvector3.push_back(37);
       vector< vector< int>> allvector;
       allvector.push_back(myvector1);
       allvector.push_back(myvector2);
       allvector.push_back(myvector3);
       for (auto v1 : allvector){
               for (auto v2 : v1){
                     std::cout << v2 << "  ";
              }
              std::cout << "\n";
       }
       std::cin.get();
}





posted @ 2015-05-26 19:15  外禅内定,程序人生  阅读(158)  评论(0编辑  收藏  举报