Assinale a alternativa que completa corretamente as linhas 34, 35 e 36 de código do método de inserção de dados (void stack::push(item_type item)) em uma pilha implementada como lista encadeada:

30 void stack::push(item_type item) {

31 if (!is_full()) {

32 node_type *location;

33 location = new node_type;

34

35

36

37 } else {

38 throw “Stack is already full!”

39 }

40 }


34 item = location-> info;
35 structure = location->next;
36 structure = location;


34 location.info = item;
35 location.next = structure;
36 structure = location;


34 structure = location;
35 location.info = item;
36 location.next = structure;


34 location->info = item;
35 location->next = structure;
36 structure = location;


34 structure = location;
35 location->info = item;
36 location->next = structure;
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.