fork download
  1. class node {
  2. element data;
  3. node* next;
  4.  
  5.  
  6. public: element& get_at(int index) {
  7. if (index == 0)
  8. return data;
  9. else {
  10. if (next == null)
  11. next = new node;
  12. return next->get_at(index-1);
  13. }
  14. }
  15. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty