What is the functionality of the piece of code

Assignment Help Basic Computer Science
Reference no: EM132322968

What is the functionality of the following piece of code? Select the most appropriate

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");
}

a) Print success if a particular element is not found

b) Print fail if a particular element is not found

c) Print success if a particular element is equal to 1

d) Print fail if the list is empty

Reference no: EM132322968

Questions Cloud

Choose one feature of windows 10 : Choose one feature of Windows 10 or any other version of Windows (Vista, 7 or 8) that could be helpful to you as a support technician.
What is a data api : a. What is a data API and why do private companies offer them?
Summarize how net neutrality will affect data networks : Go through (4) academically reviewed articles on Net Neutrality. Summarize all four (4) articles in 350 words on how net neutrality will affect data networks.
Potential threats from ai technology to society : What threats are most serious, and how might they be combated? How do they compare to the potential benefits?
What is the functionality of the piece of code : What is the functionality of the following piece of code? Select the most appropriate
End of a data science project : What are the ten main components of a report that would be delivered at the end of a data science project?
What are the aspect of all of the functions : Information Governance and Legal Functions: According to the authors, Smallwood, Kahn, and Murphy, IG is perhaps one of the functional areas that impact legal.
How the changes have affected humanity : Discuss the technological changes that have been made since 2019 and how those changes have affected humanity, and how those changes have affected themselves.
Analyze the networking needs of business : Apply networking architecture knowledge to analyze the networking needs of business - Describe and explain the protocols and interactions that implement network

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Design a check pointing and recovery algorithm

Design a check pointing and recovery algorithm that uses vector clocks, and does not assume any underlying topology (like ring or tree).

  Write a program that tracks an investment

Write a program that tracks an investment for 1 person based on the input of an interest rate.The initial balance should be $2,000. The interest should be added to the balance and output in table format as shown in the supplied sample.

  Determine many blocks of main memory in direct-mapped cache

Asumme that computer using direct-mapped cache has 2^24 words of main memory and cache of 64 blocks, where each cache block contains 16 words. How many blocks of main memory are there?

  Publicly available domain information

Using tools mentioned in the chapter (or other tools), research a domain of your choosing. Your goal is to find out publicly available information.

  Define organizational communication

1. Define organizational communication 2. What interesting about the subject of organizational communication

  Processes can exchange information to gain

In a network of processes, every process knows about itself and its immediate neighbors only. Illustrate with an example how these processes can exchange information to gain knowledge about the global topology of the network?

  Levels of the cmmi process improvement approach

1. Name and Describe two (2) U.S. based compliance laws that exist. 2. Discuss the levels of the CMMI process improvement approach.

  What is the practical minimum number of entries

Explain the purpose of each entry. What is the practical minimum number of entries?

  Encryption and decryption

Now that you have learned about encryption and decryption, and worked through some encryption of code

  Calculate annual superannuation contribution

Calculate your annual superannuation contribution. For simplicity, assume that your contributions happen annually, at the end of each year.

  Find the price and p-e ratio of the firm

a. Find the price and P/E ratio of the firm. (Do not round intermediate calculations. Round your answers to 2 decimal places.) b. Find the price and P/E ratio of the firm, if the plowback ratio is reduced to .10? (Do not round intermediate calculat..

  Display salesorderid-orderdate-totaldue

Display salesorderid, orderdate, totaldue, and territory name from salesorderheader and salesterritory for all totaldue that are greater

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