Home / MCQ Bank / Computer
Computer Introduction To Data Structures Difficulty: Medium

What is the functionality of the following code? public void function(Node node) { if(size == 0) head = node; else { Node temp,cur; for(cur = head; (temp = cur.getNext())!=null; cur = temp); cur.setNext(node); } size++; }

Select the correct option to test your answer:

More Computer Questions

Which of the following statements is true about ArrayLists in Java? How can you use regular expressions in Python? What happens when this C++ program is compiled? #include <iostream> #include <string> #include <cstdlib> using namespace std; class A { int a; public: A(){} }; class B: public A { int b; public: B(){} }; void func() { B b; throw b; } int main() { try{ func(); } catch(A a){ cout<<"Caught A Class\n"; } catch(B b){ cout<<"Caught B Class\n"; } } Determine Output: #include<stdio.h> void main() { register i=5; char j[]= "hello"; printf("%s %d", j, i); } Why is it expensive to use objects for the exception?