What is the functionality of the following code

Assignment Help Basic Computer Science
Reference no: EM132322959

What is the functionality of the following code? Choose the most appropriate answer.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;
}

a) Return data from the end of the list

b) Returns the data and deletes the node at the end of the list

c) Returns the data from the beginning of the list

d) Returns the data and deletes the node from the beginning of the list

Reference no: EM132322959

Questions Cloud

What is the functionality of the code : What is the functionality of the following code? Choose the most appropriate answer.
How to detect the presence of cycles in list effectively : Consider a small circular linked list. How to detect the presence of cycles in this list effectively?
Discussing what the chart is used for : The chart you select to represent your data will be influenced by many factors. Kirk (2016) has put each chart into the five main families below: Categorical.
Evaluating the effectiveness of interventions designed : Assignment - Evidence-Based Practice Problem - evaluating the effectiveness of interventions designed to meet the needs of adults
What is the functionality of the following code : What is the functionality of the following code? Choose the most appropriate answer.public int function()
Importance of subnet and routing of ip address : Describe and explain the protocols and interactions that implement network communications - Apply networking architecture knowledge to analyze the networking
Describe the reasons for accessing the internet : On the discussion forum, please describe the reasons for having a totally anonymous means of accessing the internet. Please also discuss the dangers of.
Different types of buffering in great detail : Discuss the importance of the different types of buffering in great detail
What are some ideas you have for your community : Interprofessional Approaches to Regional and Global Population Health Assignment - What are some ideas you have for your community

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Find whether bit string contains two consecutive one bits

You wish to find out whether bit string contains two consecutive 1 bits. Obviously, you can do this using n probes. For which values of n in range {3, 4, 5, 6, 7} can this be done using fewer than n probes?

  Applet to insert search forand delete items

Use the Array Workshop applet to insert, search for, and delete items. Make sure you can predict what it's going to do. Do this both when duplicates are allowed and when they're not.

  Market failure in the meat industry

Suggest a market based remedy for the market failure in the meat industry. Remedy for overallocation?

  Function in organizational settings

1. What are the two major forms of workforce diversity? 2. What are stereotypes and how do they function in organizational settings? 3. What are the key biographical characteristics and how are they relevant to OB?

  Do you think globalization is positive or negative

Does it increase standards of living around the world, or suffocate other cultures under an onslaught of Big Macs and Coca Cola?

  Difficulties and risks associated with public infrastructure

Assess the probable difficulties and risks associated with using a public infrastructure such as the Internet as part of a business solution.

  Determine the ratings for the following products

Using the product evaluation list for computer products, determine the ratings for the following products: DOS, Windows NT, 98, XP, Unix, and Linux.

  Troubleshoot reduced speed or latency

What are some other ways to troubleshoot reduced speed or latency? Or to find out what is using all the bandwidth? Perhaps might incorporate parts

  How can a bank create money

In the study of Economics, how can a bank create money?

  Project management process always be used for it projects

1. Should Project Management Process always be used for IT projects? Are there cases where it should not be used? List and discuss the advantages, disadvantages, and potential impacts of using PM processes.

  Customer relationship management (crm) system

All 3 assignments in this unit involve creating and building upon a Customer Relationship  Management (CRM) system for a nation-wide logistics company. In assignment 3 we aim to  link assignments 1 and 2 together in order to add a reb..

  Determining the input size

An algorithm takes 0.5 ms for input size 100. How long will it take for input size 500 if the running time is the following (assume low-order terms are negligible)?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd