Пример #1
0
 void run() {
     quint64 lastNum = 0;
     for (;;) {
         quint64 num;
         if (intQueue.dequeue(num)) {
             QVERIFY(num == lastNum);
             lastNum++;
         }
         QThread::yieldCurrentThread();
     }
 }
Пример #2
0
void AVL::breadFirstPrint(){
  TQueue<Node*> q;
  if(root_){
    q.enqueue(root_);
    while(!q.isEmpty()){
      Node* curr=q.front();
      q.dequeue();
      if(curr->left_)
        q.enqueue(curr->left_);
      if(curr->right_)
        q.enqueue(curr->right_);
      cout << curr->data_ << endl;
      
    }
  }
}