gs gs121 Abstract Data Types - Circular Linked Lists - Quiz No.1
gs gs121 Data Structures and Algorithms Quiz
This quiz belongs to book/course code gs gs121 Data Structures and Algorithms of gs organization. We have 169 quizzes available related to the book/course Data Structures and Algorithms. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Abstract Data Types. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
public int length(Node head) { int length = 0; if( head == null) return 0; Node temp = head.getNext(); while(temp != head) { temp = temp.getNext(); length++; } return length; }
public int length(Node head) { int length = 0; if( head == null) return 0; Node temp = head.getNext(); while(temp != null) { temp = temp.getNext(); length++; } return length; }
public int length(Node head) { int length = 0; if( head == null) return 0; Node temp = head.getNext(); while(temp != head && temp != null) { temp = head.getNext(); length++; } return length; }
public int length(Node head) { int length = 0; if( head == null) return 0; Node temp = head.getNext(); while(temp != head && temp == null) { temp = head.getNext(); length++; } return length; }
public void function(int data) { int flag = 0; if( head != null) { Node temp = head.getNext(); while((temp != head) && (!(temp.getItem() == data))) { temp = temp.getNext(); flag = 1; break; } } if(flag) System.out.println("success"); else System.out.println("fail"); }
public void insertHead(int data) { Node temp = new Node(data); Node cur = head; while(cur.getNext() != head) cur = cur.getNext() if(head == null) { head = temp; head.setNext(head); } else { temp.setNext(head); head = temp; cur.setNext(temp); } size++; }
public void insertHead(int data) { Node temp = new Node(data); while(cur != head) cur = cur.getNext() if(head == null) { head = temp; head.setNext(head); } else { temp.setNext(head.getNext()); cur.setNext(temp); } size++; }
public void insertHead(int data) { Node temp = new Node(data); if(head == null) { head = temp; head.setNext(head); } else { temp.setNext(head.getNext()); head = temp; } size++; }
public void insertHead(int data) { Node temp = new Node(data); if(head == null) { head = temp; head.setNext(head.getNext()); } else { temp.setNext(head.getNext()); head = temp; } size++; }
public int function() { if(head == null) return Integer.MIN_VALUE; int var; Node temp = head; while(temp.getNext() != head) temp = temp.getNext(); if(temp == head) { var = head.getItem(); head = null; return var; } temp.setNext(head.getNext()); var = head.getItem(); head = head.getNext(); return var; }
public int function() { if(head == null) return Integer.MIN_VALUE; int var; Node temp = head; Node cur; while(temp.getNext() != head) { cur = temp; temp = temp.getNext(); } if(temp == head) { var = head.getItem(); head = null; return var; } var = temp.getItem(); cur.setNext(head); return var; }