Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



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

Have Programming Question? Ask it here!
 
 
 


Amardeep singh
problem question please need urgent answers
0 Answer(s)      2 years and 3 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


Advertisement
View Answers

Related Tutorials/Questions & Answers:
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
Advertisements
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
urgent need
urgent need   Input a line. Count the number of words that start with a capital letter
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
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
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
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
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
I really need help with this assignment question Please help me out Please
I really need help with this assignment question Please help me out Please  * Description* You are hired to develop a laptop inventory information... in MySQL. For this purpose you will need to use the sheridancollege database we
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
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
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
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
its very urgent please help me
its very urgent please help me  how can i retrieve all images from ms access database and display in jsp pages
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
i need a help in this please
i need a help in this please  The factorial of a nonnegative integer n is written n! (pronounced ‚?? n factorial‚??) and is defined as follows: n!=n . (n-1) . (n-2) . .... . 1 (for values of n greater than or equal to 1) and n!=1
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
Image problem Urgent - JSP-Servlet
Image problem Urgent  Respected Sir/madam, I am R.Ragavendran.. Actually I got your coding.. But This code is not enabling the user to click and change the image.. I request you to remember the code which you have
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
Please provide the coding for this problem
Please provide the coding for this problem  Please provide the coding for the following problem. Write a "hangman" game that randomly generates a word and prompts the user to guess one letter at a time. Each letter in the word
please help me to this problem..
please help me to this problem..  i wrote a program like keyboard and i used [JTextFiled] means that just you can write inside the program (i.e inside the JTextField) but i want to make this program to let me write where i
PLEASE HELP CAPTCHA PROBLEM
PLEASE HELP CAPTCHA PROBLEM  how can i make the captcha refresh autometically ???? please help this is <%@ Page Language="C#" %> <%@ Import Namespace="System.Drawing"%> <%@ Import Namespace
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
need to fix errors please help
need to fix errors please help  it does have 2 errors what should i...; String name2; System.out.println("please enter your name:"); name1= input.readline(); System.out.println("please enter your friend's name:"); name2
Please help need quick!!! Thanks
Please help need quick!!! Thanks  hey i keep getting stupid compile errors and don't understand why. i'm supposed to use abstract to test a boat race simulation program of sorts here is my code: RentforthBoatRace.java public
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
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
Please provide coding for following problem
Please provide coding for following problem  Please provide the coding for the following problem: You will write a java program that will read data from a file. The data in the file will be: John Doe 75 Joe Blow 65 Mary Smith 80
PROJECT ON JAVA NET BEANS AND MYSQL !! PLEASE HELP URGENT
PROJECT ON JAVA NET BEANS AND MYSQL !! PLEASE HELP URGENT  i need a project based on connectivity..it can be based on any of the following topics... record keeping system   Please visit the following link: http
CAN ANYONE SOLVE THIS FOR ME. URGENT HELP NEEDED. PLEASE HELP
CAN ANYONE SOLVE THIS FOR ME. URGENT HELP NEEDED. PLEASE HELP   The Task Write a class whose objects will represent students. The class should have three fields for representing a student‚??s
CAN ANYONE SOLVE THIS FOR ME. URGENT HELP NEEDED. PLEASE HELP
CAN ANYONE SOLVE THIS FOR ME. URGENT HELP NEEDED. PLEASE HELP   Write a class whose objects will represent students.The class should have three fields for representing a student√Ę‚?¨‚?Ęs name, this student√Ę‚?¨‚?Ęs
please help me to overcome this problem
please help me to overcome this problem  how to make it easy to write java code. can u please give me suggestions
Netbeans Question need help desperately!!
Netbeans Question need help desperately!!   Ok here is my code- public class RollDie2 { public static void main(String[] args) { Random randomNumber = new Random(); int[][] frequency = new int[9][9]; int die1 = 0; int
Would you know answer means please send reply urgent
Would you know answer means please send reply urgent  HTTP Status 404 - /struts/HelloWorld.jsp type Status report message /struts/HelloWorld.jsp description The requested resource (/struts/HelloWorld.jsp) is not available
problem in writing coding. Please help me.
problem in writing coding. Please help me.  Hi sir, my name is Logeswaran. I have problem in writing JSP coding for my university assigments. Actually I'm doing a Voting System. I need to know how to write JSP coding
Need Help Like No one Else Please
Need Help Like No one Else Please   write a program that computes miles per gallon for an automobile. The program should ask for the beginning mileage first. For each fill-up, the program should ask for the mileage and number
Please , can any one answer this Question?
Please , can any one answer this Question?  How to cummunicate one web application to another web application in different places
please give me an idea to develop a program for this question?
please give me an idea to develop a program for this question?  How to enter a text or number from keyboard without using InputStreamReader method in java
JSP:NEED RESPONSE ASAP PLEASE! - JSP-Servlet
JSP:NEED RESPONSE ASAP PLEASE!  Hi freind, If you could respond to my previous thread which hasn't been addressed for over a week, I'd really appreciate it. and most important if you could just respond to below. thank you I
i need help to solve this problem
i need help to solve this problem  Write a stack class ArrayStack.java implements PureStack interface that reads in strings from standard input and prints them in reverse order. and Show step by step what queue will look like
beginner need help with online ordering program please
beginner need help with online ordering program please  I have created a program for an online ordering system and now have to add error handling and a few other things my teacher doesn't teach well is there a template I can go
Struts2 Helloworld problem -Please help - Struts
Struts2 Helloworld problem -Please help  Hi I am a beginner... problem I unable to execute the program successfully. Please find my example.... Please help me out in resolving this problem and provide me a pointer
please help me to solve this question about array
please help me to solve this question about array  write a program...() > 1) System.out.println("It is not character. Please enter...(); if (brr.length() > 1) System.out.println("It is not character. Please
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
Checkbox Problem--Please Check this - JSP-Servlet
Checkbox Problem  I am facing a problem while creating a check box in JavaScript. Can any one share the part of code to create a checkbox in JavaScript
please give me a java program for the following question
please give me a java program for the following question  Write a java program that displays multiple frames : Step 1: Design a frame with three buttons: ?Fruit?, ?Bird? and ?Animal? Step 2: On clicking ?Fruit? button
urgent need for jsp code with mysql query for uploading and downloading file - JSP-Servlet
urgent need for jsp code with mysql query for uploading and downloading file  can anyone tell me how to upload and download a doc file using jsp with mysql as the back end... and kindly help me to create the table too
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   
Advertisements
 

 

 

DMCA.com