Home Answers Viewqa Java-Interview-Questions problem question please need urgent answers

 
 


Amardeep singh
problem question please need urgent answers
0 Answer(s)      11 months ago
Posted in : Java Interview Questions

Problem Statement

Given a cyclic list with elements as numbers in sorted order, write a function to insert a new element (5) into the cyclic list that maintains the sorted order of the cyclic list. Do not assume that the cyclic list is referenced by its minimal element. A perfectly cyclic list is one where the nth node's 'next' pointer points to the same place as 'head' --

User would get a custom data type as Node. It is defined as

public class Node { public int data; public Node next; }

You are given a function addElement which takes in the head pointer of the cyclic linked list. Complete the function to insert the number 5 such that the sorted order is maintained and return the head node of the modified linked list. You only need to complete this function. The Main and Node classes for storing linked list are already defined, so you will not need to add them. Every time you submit your code it will be compiled and a small suite of tests will be run against your code and you will be shown the results. When you complete the problem a larger suite of tests will be run to test your implementation. If you successfully pass the displayed tests, use your extra time to make sure your code handles other edge cases appropriately.

Input/Output Specs Inputs Specs: The data in test case starts and ends with brackets ( ). Within the brackets lies the following information (Node input1) where input1 is the head pointer of the cyclic linked list. A cyclic linked list i.e. the next of the Last node is the first node , so for {1,2} the Node having 1 would have the next element as 2 and the node with data as 2 the next value would point to 1 Output Specs: You need to return the head node of the modified linked list.

Examples Input values: 2->6

Expected Output value : 2->5->6

View Answers









Related Pages:
problem question please need urgent answers
problem question please need urgent answers  Problem Statement Given.... You only need to complete this function. The Main and Node classes for storing linked list are already defined, so you will not need to add them. Every time you
problem question please need urgent answers
problem question please need urgent answers  Problem Statement Given.... You only need to complete this function. The Main and Node classes for storing linked list are already defined, so you will not need to add them. Every time you
urgent help for inserting database in a project
urgent help for inserting database in a project   I need some urgent...; answers to question "+(quesnum+1)+ "<html>","User... and then the result at the end.I need to add simple database connectivity
urgent help for inserting database in a project
urgent help for inserting database in a project   I need some urgent...; answers to question "+(quesnum+1)+ "<html>","User... and then the result at the end.I need to add simple database connectivity
Please help me urgent...........
Please help me urgent...........  For what kind of a problem would use a Tree Set and not a Tree Map For what kind of a problem would use a Tree Map and not a Tree Set   Hello Friend, If you want to display the list
Need the program urgent veryyyyyyyyyyyyy urgent plsssssssssssssssssss follow the standard in the program
Need the program urgent very urgent please follow the standard in the program  Restaurant Order Management System (ROMS) Problem Case: Create a ROMS system, which is intended to take an order from the customer and charge
Interview Questions and Answers
this question, you need to step into the customer’s shoes. Keep aside... to say. This question might be used as a filter, so you need to give a response... Interview Questions and Answers   
Software Questions and Answers
; and browser questions and answers at Flex Question and Answer page. Ask... in the software development. This Question and Answers section helps the developers... and Answers here Thanking for your visiting our Question and Answers section
question
question  Good afternoon Sir, i need a code to inser url in to table using mysql + jsp Please help me it's urgent
question
question  Good after noon Sir, Please send me the code of the problem given below.it's urgent code to display employees on absent and manager can approve,and send a notification message to an employee.using JPanel+mysql+Java
please help me to answers this question about C++.....huuhuhuhu
please help me to answers this question about C++.....huuhuhuhu  1) Write a full program for the bubble sort algorithm. User is required to enter specific input numbers and the program will be able to sort the given numbers
please help me to answers this question about C++.....huuhuhuhu
please help me to answers this question about C++.....huuhuhuhu  1) Write a full program for the bubble sort algorithm. User is required to enter specific input numbers and the program will be able to sort the given numbers
question
question  good morning, please give me a jsp+mysql code to calculate... sunday.i need to take all half days to curresponding number of full day leave.if you... salary according to leave,it's urgent
Software Questions and Answers
questions  and browser questions and answers at Flex Question..., latest trends in the software development. This Question and Answers section... latest Questions and Answers here Thanking for your visiting our Question
Need urgent help with C++ errors!
Need urgent help with C++ errors!  hi, i'm new to C++ programming... don't know what to do. Please help!! #include<iostream.h> void main...' Fatal XYZ.CPP 2: Unable to create output file 'C:\XYZ.obj' somebody please
question
It's very urgent I have interviews , please send me as soon as possible.   ...question  Dear Sir , could you please send me programmatic type...; Java Interview Questions and their Answers
urgent need
urgent need   Input a line. Count the number of words that start with a capital letter
java apptitude question and answers - Java Beginners
java apptitude question and answers  i want java appititude question and answers  Hi Friend, Please visit the following link: http://www.roseindia.net/interviewquestions/ Thanks
onfly conversion of jsp to pdf (urgent) - Development process
page in which we show the question id, ques answers. now the problem is that i...onfly conversion of jsp to pdf (urgent)  Hi, i m facing problem... session and also from DataBase. i m using struts1.1 servlet, jsp. please suggest
need help please
need help please  Dear sir, my name is logeswaran. I have a big problem that I can't find the solution for a program. How can I block a user from enter a page second time. Please help me. By the way I'm using Access database
Question Answer
HERE |ASK QUESTIONS Here, you can post your desired question. For posting any question / query, please follow these steps: Only post your Java or Open Source or technical problem not comments in this section
need help...................please
need help...................please  I have a problem in my JSP Coding... on this area. Please help me. By the way, I'm using access Database and JSP coding...("GET",url,true) xmlHttp.send(null) } else{ alert("Please Select Employee Id
Questions and Answers Help
programmers to give precise answers to your question. Describe your question...Questions and Answers Help      ... the detailed description of the problem you are getting while running your
Questions and Answers Help
programmers to give precise answers to your question. Describe your question...Questions and Answers Help      ... the detailed description of the problem you are getting while running your
Please help me... its very urgent
Please help me... its very urgent  Please send me a java code to check whether INNODB is installed in mysql... If it is there, then we need to calculate the number of disks used by mysql
urgent...pleAse help me.....please!
urgent...pleAse help me.....please!  please help me urgent! how can i do dictionary with the use of array code in java, where i will type the word then the corresponding meaning for that word will appear...thanks
question
question  i need a mysql query to take a date in between current date and previous date from date time colomn in table.please help me View Answers View Answers
Java Programming: Chapter 4 Quiz Answers
Sample Quiz Answers For Chapter 4 THIS PAGE CONTAINS SAMPLE ANSWERS to the Quiz on Chapter 4 of this on-line Java textbook. Note that in many cases, there are lots of correct answers to a given question. Question
Java Programming, Chapter 12 Quiz Answers
Sample Quiz Answers For Chapter 12 THIS PAGE CONTAINS SAMPLE ANSWERS to the Quiz on Chapter 12 of this on-line Java textbook. Note that in many cases, there are lots of correct answers to a given question
Java Programming: Chapter 6 Quiz Answers
Sample Quiz Answers For Chapter 6 THIS PAGE CONTAINS SAMPLE ANSWERS to the Quiz on Chapter 6 of this on-line Java textbook. Note that in many cases, there are lots of correct answers to a given question. Question
Basic problem but very urgent - JSP-Servlet
me the cause of the problem asap because its most urgent.. Thanks/Regards...Basic problem but very urgent  Respected Sir/Madam, I am... problem which i hava tried my level best to solve.In the output, the text box
urgent need in two days - JSP-Servlet
){ if(theForm.firstname.value==""){ //Please enter accountholder alert...; } if (isProper(theForm.firstname.value) == false) { alert("Please... false; } if(theForm.address.value==""){ //Please enter accountholder
struts problem ... need help urgently.. please reply ASAP
struts problem ... need help urgently.. please reply ASAP  Hi Every1, I want to make an application using struts 1.2. I am a beginner on struts... depends on server or IDE. Please reply ASAP. Thanx , am2085
question
question  Sir, Please send me Java Swing source code for video streaming , it's very urgent
Question
the given code). please also send me the answers with the questions...Question  Good afternoon sir could you please send me program style java interview questions and answers for one year experianced candidates.ie
Question
). please also send me the answers with the questions...java interview questions and answers for one year experianced candidates  Good afternoon sir could you please send me program style java interview
PLZ Need some help on the 2nd part of this question...Someone please help !!!!
PLZ Need some help on the 2nd part of this question...Someone please help !!!!  write an application that displays a menue of three items in a restaurant as follows: 1.Cheeseburger 4.99 2.Pepsi 2.00 3.Chips 0.75 prompt the user
question
question  i need a mysql query to take a time in between current time and previous time from date time colomn in table.please help me View Answers
question
question  good afternoon sir, please send me a simple Jsp or Java code to display a calendar with Indian public holidays,current date and time.It is very urgent,please consider and me as soon as possible
Question
sir could you please send me program style java interview questions and answers... of given code(to find out result from the given code). please also send me the answers with the questions
question
question  please give me the relevant modules and details to start java coding for "Deriving Concept-based User Profiles from Search Engine Logs" it's very urgent
urgent please, help!
urgent please, help!  how to make jTable unclickable and have unmovable columns, thanks in advance   import javax.swing.*; import java.awt.*; public class SimpleJTableExample{ public static void main(String[] args
very urgent - Java Server Faces Questions
output is not coming.I explain about the output in previeous question. Please check it once and give me a correct solution. It is very urgent for me. Thanks.... For Solving the problem read carefully visit to : http://www.roseindia.net
Simple problem Very Urgent - JSP-Servlet
Simple problem Very Urgent  Respected SDir/Madam, I am... problem which i hava tried my level best to solve. A pop up window is opening..._value=="" || emp_value==null) { alert("Please select Employee Id"); return
question
question  i need to set trigger using jsp with mysql query,please help me
question
question  please help me to correct the problem in following one JFmeasure newContentPane = new JFmeasure(d,recall,sfme); **error : Multiple markers at this line - JFmeasure cannot be resolved to a type
question
question  i need to select data from database using mysql+java script+html   Please specify some more details
Please Help To Solve My Problem
Please Help To Solve My Problem  PHP I Have 6 Textbox and 1 ok... This Problem With If...Else If...Else Statement But When the More Team Are There Then It's Large Codding So I Need To Help To Another Way To Do
question
question  i need to mark employees as half day absent who came after 10'o clock in my web project,so i need to know who are all late entry.if you have any idea using jsp and mysql please help me
question
question  i need a simple jsp + mysql code to display all absentees.and please send,if have any option to send any notification message to user who forgot to mark attendance

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.