Assinale a alternativa que completa corretamente as linhas 54, 55, 56, 57 e 58 de código do método de remoção de dados (item_type stack::dequeue()) em uma fila implementada como lista encadeada:

50 item_type queue::dequeue() {

51 if (!is_empty()) {

52 node_type *pointer;

53 pointer = front;

54

55

56
57
58

59 delete pointer;

60 return item;

61 } else {

62 throw “Queue is empty!”;

63 }

64 }


54 item_type item = front->info;
55 front = front->next;
56 if (front == NULL) {
57 rear = NULL;
58 }


54 item_type item = front->info;
55 front = front->next;
56 if (rear == NULL) {
57 front = rear;
58 }


54 item_type item = front->info;
55 front = front->next;
56 if (front = NULL) {
57 rear = NULL;
58 }


54 item_type item = front->info;
55 front = front->next;
56 if (front != NULL) {
57 rear = NULL;
58 }


54 front = front->next;
55 item_type item = front->info;
56 if (front == NULL) {
57 rear = NULL;
58 }
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Lista de comentários


Helpful Social

Copyright © 2024 ELIBRARY.TIPS - All rights reserved.