kumar.prince6
BAN USER- -1of 1 vote
AnswersArray
- kumar.prince6 in United States
(
[0] => Array
(
[increment_id] => 3859
[payment_refrence_id] =>
[dealskart_order_id] => 0
[payment_method] => cash
[prepaid_amount] => 0
[subtotal] => 3915.00
[discount] => 783.00
[grand_total] => 3288.60
[created_at] => 2015-04-15 11:53:55
[franchise_id] => 35
[store_credit] => 0.00
[item_id] => 9912
[product_id] => 38753
[custom_options] => {"74104":{"label":"Right Boxes","value":"1 Box"},"74105":{"label":"Right Power (SPH)","value":"0.00"},"74106":{"label":"Right CYL","value":"-1.50"},"74107":{"label":"Right Axis","value":"20"},"342391":{"label":"Right Color","value":"Calypso Green"},"74088":{"label":"Left Boxes","value":"2 Boxes"},"74089":{"label":"Left Power (SPH)","value":"Call Me\/Email Me for Power"},"74090":{"label":"Left CYL","value":"-1.00"},"74091":{"label":"Left Axis","value":"10"},"342395":{"label":"Left Color","value":"Peppy Brown"}}
[item_subtotal] => 1096.00
[item_discount] => 261.00
[item_grandtotal] => 1096.00
[qty] => 1
[product_name] => Celebration Toric Yearly Colors Lenses
[sku] => contact:celebration-calypso-green-new
[franchise_name] => testing
[street] => d12/2 valyoo technologies
[country_id] => INDIA
[city] => Mangalore
[region] => Karnataka
[postcode] => 575003
[fax] => 10
[telephone] => 9818708981
[is_franchise] => 1
[gift_voucher_amount] => 0.00
)
[1] => Array
(
[increment_id] => 3859
[payment_refrence_id] =>
[dealskart_order_id] => 0
[payment_method] => cash
[prepaid_amount] => 0
[subtotal] => 3915.00
[discount] => 783.00
[grand_total] => 3288.60
[created_at] => 2015-04-15 11:53:55
[franchise_id] => 35
[store_credit] => 0.00
[item_id] => 9913
[product_id] => 38753
[custom_options] => {"74104":{"label":"Right Boxes","value":"1 Box"},"74105":{"label":"Right Power (SPH)","value":"0.00"},"74106":{"label":"Right CYL","value":"-1.50"},"74107":{"label":"Right Axis","value":"20"},"342391":{"label":"Right Color","value":"Calypso Green"},"74088":{"label":"Left Boxes","value":"2 Boxes"},"74089":{"label":"Left Power (SPH)","value":"Call Me\/Email Me for Power"},"74090":{"label":"Left CYL","value":"-1.00"},"74091":{"label":"Left Axis","value":"10"},"342395":{"label":"Left Color","value":"Peppy Brown"}}
[item_subtotal] => 1096.00
[item_discount] => 261.00
[item_grandtotal] => 1096.00
[qty] => 1
[product_name] => Celebration Toric Yearly Colors Lenses
[sku] => contact:celebration-calypso-green-new
[franchise_name] => testing
[street] => d12/2 valyoo technologies
[country_id] => INDIA
[city] => Mangalore
[region] => Karnataka
[postcode] => 575003
[fax] => 10
[telephone] => 9818708981
[is_franchise] => 1
[gift_voucher_amount] => 0.00
)
[2] => Array
(
[increment_id] => 3859
[payment_refrence_id] =>
[dealskart_order_id] => 0
[payment_method] => cash
[prepaid_amount] => 0
[subtotal] => 3915.00
[discount] => 783.00
[grand_total] => 3288.60
[created_at] => 2015-04-15 11:53:55
[franchise_id] => 35
[store_credit] => 0.00
[item_id] => 9914
[product_id] => 38753
[custom_options] => {"74104":{"label":"Right Boxes","value":"1 Box"},"74105":{"label":"Right Power (SPH)","value":"0.00"},"74106":{"label":"Right CYL","value":"-1.50"},"74107":{"label":"Right Axis","value":"20"},"342391":{"label":"Right Color","value":"Calypso Green"},"74088":{"label":"Left Boxes","value":"2 Boxes"},"74089":{"label":"Left Power (SPH)","value":"Call Me\/Email Me for Power"},"74090":{"label":"Left CYL","value":"-1.00"},"74091":{"label":"Left Axis","value":"10"},"342395":{"label":"Left Color","value":"Peppy Brown"}}
[item_subtotal] => 1096.00
[item_discount] => 261.00
[item_grandtotal] => 1096.00
[qty] => 1
[product_name] => Celebration Toric Yearly Colors Lenses
[sku] => contact:celebration-calypso-green-new
[franchise_name] => testing
[street] => d12/2 valyoo technologies
[country_id] => INDIA
[city] => Mangalore
[region] => Karnataka
[postcode] => 575003
[fax] => 10
[telephone] => 9818708981
[is_franchise] => 1
[gift_voucher_amount] => 0.00
)
)
3
how to count [custom_options]| Report Duplicate | Flag | PURGE
- 0of 0 votes
AnswersI have used my personal google API key here, you can use that or generate your own.
- kumar.prince6 in United States
The response id JSON:
{
"destination_addresses" : [ "Sector 15, Faridabad, Haryana, India" ],
"origin_addresses" : [ "GBN School, Sector 21D, Faridabad, Haryana 121001, India" ],
"rows" : [
{
"elements" : [
{
"distance" : {
"text" : "6.1 km",
"value" : 6054
},
"duration" : {
"text" : "12 mins",
"value" : 716
},
"status" : "OK"
}
]
}
],
"status" : "OK"
}
Base Algorithm or the rule engine for scheduling:
For the examples, let us assume pincode 121001, with 3 cabs cab1, cab2 & cab3.
The time slots are:
9:00 am to 10:30 am, 10:30 am to 12:00 pm, 12:00 pm to 1:30 pm, 2:30 pm to 4:00 pm, 4:00 pm to 5:30 pm and 5:30 pm to 7:00 pm
Non-real time scheduling
For an appointment of any time slot, say 4:00 pm to 5:30 pm, check the cabs allotted for adjacent slots, 2:30 pm to 4:00 pm and 5:30 pm to 7:00 pm for this example.
1) If no cabs are allotted for adjacent slots, then assign any random cab, say cab1.
2) Else, say cab2 is allotted to slot 2:30 pm to 4:00 pm and cab3 to 4:00 pm and 5:30 pm. Using google distance matrix api (referred to as gdm api from now on), find which cab is within x kms (x should be configurable, e.g 5 kms would be a good start) of the new appointment.
2.1) If one of the cabs is within x kms, assign it to this time slot.
2.2) If both cabs are within x kms, assign the one that is closer. If the difference is imperceptible, assign one randomly.
2.3) If both cabs are more than x kms, assign it to cab1
2.4) If cab1 was also allotted one of the adjacent time slots, then assign the nearest cab to this time slot. If the difference is imperceptible, assign one randomly.
Real time scheduling
This is applicable for appointments for the same day.
The same algorithm can be used, but use time to travel from the gdm api, instead of distance, since it accounts for traffic.
Feel free to discuss details or suggest changes in the rule engine.| Report Duplicate | Flag | PURGE
Dev Lead Dev Lead - 0of 0 votes
AnswerGaurav is a 12 year old student who’s fractured his leg and lower back in a bicycle accident and
- kumar.prince6 in United States
is on a bed rest for the next 2 months. He keeps himself busy by watching television on his
Skycast DTH. While watching the television, one day he decided to play a small game, where
he has to identify the minimum number of clicks required to surf a given set of channels in a
sequence. He quickly decided that it makes for an interesting problem to solve using a software
program, (oh, forgot to tell you that he likes to code when he is not busy with his school work).
Your task is to write the software program (using any of the programming language choices
given), before Gaurav can do it himself, we think he is going to take 2 hours, so you think you
can beat the 12 year old in solving this, we think so! Your time starts now!
Obviously the program has to take the following instructions and constraints into account.
Instructions
There are 13 buttons on his remote: 10 buttons for the numbers (0-9), an "Up Channel" button,
a "Down Channel" button, and a "Back" button:
● The number buttons allow you to jump directly to a specific channel. (Ex: to go to
channel 63 by typing “6”, “3”.)
● The "Up Channel" button increments the current channel to the next higher viewable
channel, unless the current channel is the highest viewable channel, in which case it
rolls over to the lowest viewable channel.
● The "Down Channel" button decrements to the next lower viewable channel, unless the
current channel is the lowest viewable channel, in which case it rolls over to the highest
viewable channel.
● The "Back" button reverts to whatever channel was on the television before the current
channel. (Ex: If channel 1 is viewed, then channel 100, then when Back is pressed, the
television will go to channel 1.)
Gaurav can get from one channel to the next in one of the two ways:
● Clicking any combination of "Up Channel", "Down Channel", and "Back" buttons.
● Keying in the numbers to the channel. Gaurav will never combine "Back" and number
buttons when moving from one channel to the next.
Gaurav’s parents have set some parental control on some channels on Gaurav's television.
These channels are not viewable, so they are skipped by the "Up Channel" and "Down
Channel" buttons.
Given a list of channels to view, the lowest channel, the highest channel, and a list of blocked
channels, your program should return the minimum number of clicks necessary to get
through all the shows that Gaurav would like to watch.
Input
Page 2
Your program has to take 3 inputs for each test case, the first input will contain two space
delimited numbers, these will form the lowest channel and the highest channel. The next input
will contain the number of blocked channels followed by sequence of blocked channels (again
space delimited). The first number in the input will contain the number of inputs The last input is
the sequence of channels that Gaurav must view (in order). Again, the first number will contain
the number of inputs
Notes:
● Unit tests are mandatory, so please ensure that the code you submit has automated unit
tests and you adopt TDD principles (as it applies to this problem statement)
Sample Input
Test Case #1
1 20
2 18 19
5 15 14 17 1 17
Test Case #2
103 108
1 104
5 105 106 107 103 105
Test Case #3
1 100
4 78 79 80 3
8 10 13 13 100 99 98 77 81
Test Case #4
1 200
0
4 1 100 1 101
Sample Output
Output for Test Case #1:
7
Output for Test Case #2:
8
Output for Test Case #3:
12
Output for Test Case #4:
7
Constraints
● The lowest channel on the television will be greater than 0, and less than or equal to
10,000.
● The highest channel on the television will be greater than or equal to lowest channel,
and less than or equal to 10,000.
● The list of channels that are blocked on Gaurav's television. All the channels in this list
will be valid channels (greater than or equal to lowest channel, less than or equal to
Page 3
highest channel). Duplicates may be ignored. The blocked list can be maximum of 40
channels.
● The sequence that Gaurav must view contains between 1 and 50 elements, inclusive. All
channels in this sequence are not in the blocked list and are between lowest channel
and highest channel, inclusive.| Report Duplicate | Flag | PURGE
Algorithm - 0of 0 votes
AnswersGiven a string, print the character which appears the maximum number of times in the string.
- kumar.prince6 in United States
The string will contain only ascii characters. If there is a tie in the maximum number
of times a character appears in the string, print the character which appears first in the string.
Notes:
1. The length of the string will be between 1 and 10000, inclusive.
2. Make sure you don't print anything other than a single character in the function. Otherwise, your solution will be marked wrong.
3. You only need to complete the function printMaximumOccurringCharacter.
Sample Input #00
helloworld
Sample Output #00
l
Sample Input #01
aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
Sample Output #01
a
Sample Input #02
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
Sample Output #02
a
4.| Report Duplicate | Flag | PURGE
Expedia Developer Program Engineer Algorithm - 0of 0 votes
Answers.There is an infinite integer grid at which N people have their houses on. They decide to unite at
- kumar.prince6 in United States
a common meeting place, which is someone's house.
From any given cell, all 8 adjacent cells are reachable in 1 unit of time.
eg: (x,y) can be reached from (x-1,y+1) in a single unit of time.
Find a common meeting place which minimises the sum of the travel times of all the persons.
Input Format:
N
The following N lines will contain two integers saying the x & y coordinate of the i-th person.
Output Format:
M M = min sum of all travel times;
Constraints:
N <= 10^5
The absolute value of each co-ordinate in the input will be atmost 109
HINT: Please use long long 64-bit integers;
Input #00:
4
0 1
2 5
3 1
4 0
Output #00:
8
Explanation: Sums of travel times of the houses are 11, 13, 8 and 10. 8 is the minimum.
Input #01:
6
12 -14
-3 3
-14 7
-14 -3
2 -12
-1 -6
Output #01:| Report Duplicate | Flag | PURGE
Expedia Developer Program Engineer Algorithm - 0of 0 votes
AnswersProblem statement
- kumar.prince6 in United States
You are planning a big programming conference and have received many proposals which have passed
the initial screen process but you're having trouble fitting them into the time constraints of the day -- there
are so many possibilities! So you write a program to do it for you.
· The conference has multiple tracks each of which has a morning and afternoon session.
· Each session contains multiple talks.
· Morning sessions begin at 9am and must finish by 12 noon, for lunch.
· Afternoon sessions begin at 1pm and must finish in time for the networking event.
· The networking event can start no earlier than 4:00 and no later than 5:00.
· No talk title has numbers in it.
· All talk lengths are either in minutes (not hours) or lightning (5 minutes).
· Presenters will be very punctual; there needs to be no gap between sessions.
Note that depending on how you choose to complete this problem, your solution may give a different
ordering or combination of talks into tracks. This is acceptable; you don’t need to exactly duplicate the
sample output given here.
Test input:
Writing Fast Tests Against Enterprise Rails 60min
Overdoing it in Python 45min
Lua for the Masses 30min
Ruby Errors from Mismatched Gem Versions 45min
Common Ruby Errors 45min
Rails for Python Developers lightning
Communicating Over Distance 60min
Accounting-Driven Development 45min
Woah 30min
Sit Down and Write 30min
Pair Programming vs Noise 45min
Rails Magic 60min
Ruby on Rails: Why We Should Move On 60min
Clojure Ate Scala (on my project) 45min
Programming in the Boondocks of Seattle 30min
Ruby vs. Clojure for Back-End Development 30min
Ruby on Rails Legacy App Maintenance 60min
A World Without HackerNews 30min
User Interface CSS in Rails Apps 30min
Test output:
Track 1:
09:00AM Writing Fast Tests Against Enterprise Rails 60min
10:00AM Overdoing it in Python 45min
10:45AM Lua for the Masses 30min
11:15AM Ruby Errors from Mismatched Gem Versions 45min
12:00PM Lunch
01:00PM Ruby on Rails: Why We Should Move On 60min
02:00PM Common Ruby Errors 45min
02:45PM Pair Programming vs Noise 45min
03:30PM Programming in the Boondocks of Seattle 30min
04:00PM Ruby vs. Clojure for Back-End Development 30min
04:30PM User Interface CSS in Rails Apps 30min
05:00PM Networking Event
Track 2:
09:00AM Communicating Over Distance 60min
10:00AM Rails Magic 60min
11:00AM Woah 30min
11:30AM Sit Down and Write 30min
12:00PM Lunch
01:00PM Accounting-Driven Development 45min
01:45PM Clojure Ate Scala (on my project) 45min
02:30PM A World Without HackerNews 30min
03:00PM Ruby on Rails Legacy App Maintenance 60min
04:00PM Rails for Python Developers lightning
05:00PM Networking Event| Report Duplicate | Flag | PURGE
Developer Program Engineer Algorithm - 0of 0 votes
AnswersData Structure for node of linked list
- kumar.prince6 in India for IDC
Find the nth node form end of a linked list and also write test case
i have given solution with o(n) after that they asked to me how to break the my algorithm| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 0of 0 votes
AnswersDesign an algorithm to remove the duplicate characters in a string without using any additional buffer. NOTE: One or two additional variables are fine. An extra copy of the array is not. also do with o(n2),o(n),o(1) ,write test case and breake the algorithm whatever you write.
- kumar.prince6 in India for IDC| Report Duplicate | Flag | PURGE
Amazon SDE1 - 0of 0 votes
AnswersIn a grid, you are given a position, and every location has some value. find the shortest length so that you can touch to any boundary of the grid. I code it then she asked me to optimize it, I did that also.
- kumar.prince6 in United States| Report Duplicate | Flag | PURGE
Groupon SDE1 - 0of 0 votes
AnswersYou have a binary tree on client machine, how will u send this info to server and how will you again maintain the tree over the server. I thought few mins, tell him my approach, he was asking for easier way. Then finally I told him my approach. He was satisfied and told me to write the code how and what info will u send and how will u again maintain it on the server, I write both the codes and He was very satisfied with my code.
- kumar.prince6 in United States| Report Duplicate | Flag | PURGE
Groupon SDE1 - 0of 0 votes
AnswersYou have a robot in a grid, it can move in forward direction and can change its facing towards north, south, east n west and you are given a command sequence. So what will be the final position of the robot
- kumar.prince6 in India
Example
Grid(100*500)
Robot Position – (5,3)
Sequence — {N,S,M,M,E,W,E,S,M,S,M} North, East, West, South, Move forward| Report Duplicate | Flag | PURGE
Groupon SDE1 Algorithm - 0of 0 votes
AnswersGiven a ternary string, you have to count the total number of contiguous substrings (contigious set of characters), that you can form from this given string such that they comprise of either only one or two different characters.
- kumar.prince6 in India
Please note that a unique substring will be decided by its starting and ending indices. So, a substring 'ab' with starting and ending indices being 1 and 2 respectively should be considered different from a substring 'ab' with starting or ending indices (or both) other than 1 and 2 respectively.
For example:
input ternary string - aabc
output - 8
The above string comprises of the following substrings that have either one or two of the characters - a, a, b, c, aa, ab, bc and aab. So the final answer is a total of eight substrings.
input ternary string - abc
output - 5
The above string comprises of the following substrings that have either one or two of the characters - a, b, c, ab and bc. So the final answer is a total of five substrings.
input ternary string - baaccb
output - 16
The above string comprises of the following substrings that have either one or two of the characters - b, a, a, c, c, b, aa, cc, ba, ac, cb, baa, aac, acc, ccb and aacc. So the final answer is a total of sixteen substrings| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer Algorithm - 0of 0 votes
Answers3.Find the first unique character in a Stream. Please note that you are being provided a stream as a source for these characters.
- kumar.prince6 in India
The stream is guaranteed to eventually terminate (i.e. return false from a call to the hasNext() method), though it could be very long. You will access this stream through the provided interface methods.
A call to hasNext() will return whether the stream contains any more characters to process.
A call to getNext() will return the next character to be processed in the stream.
It is not possible to restart the stream.
If there is no unique character, then return the character '#'. # won't be any character in the character stream.
You just have to complete the function getUniqueCharacter() using the functions hasNext() and getNext() which are already defined.
Example:
Input:
aAbBABac
Output:
b
Input:
aBBa
Output:
#| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 0of 0 votes
Answers2.Given an integer linked list of which both first half and second half are sorted independently. Write a function to merge the two parts to create one single sorted linked list in place [do not use any extra space].
- kumar.prince6 in India
Sample test case:
Input: List 1:1->2->3->4->5->1->2; Output: 1->1->2->2->3->4->5
Input 2: 1->5->7->9->11->2->4->6; Output 2: 1->2->4->5->6->7->9->11
C/C++/Java/C#
struct node
{
int val;
node *next;
}
node* sortList(node* list1) {
}
Java
class Node
{
int val;
Node next;
}
Node sortList(Node list1) {
}| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 0of 0 votes
Answers1.You are given a function calcDifference which takes in the root pointer of a
- kumar.prince6 in India
binary tree as it's input. Complete the function to return the sum of values of nodes at
odd height - sum of values of node at even height. Consider the root node is at height 1
/* Write your own custom functions here */
int calcDiff(node * root){
/*
struct node {
struct node *left,*right;
int val;
node(int x){
val = x;
}
};
typedef struct node node;
The structure is already declared, you can just start initializing nodes
*/
}| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersProblem Statement :
- kumar.prince6 in India
• Given an 4n X 4n Matrix, where n is a positive integer taken as input. Imagine the matrix consisting of two interleaved coils whose centers are at the centre of the matrix. Implement a java program which takes an integer (n) as input and prints the two coils in two seperate lines.
Please have a look at the below examples to get a sense of what the two coils are :
• Example 1:
• Input: 1
• Matrix:
01 02 03 04
05 06 07 08
09 10 11 12
13 14 15 16
• Output the Two Coils as:
- Coil1: 10 06 02 03 04 08 12 16
- Coil2: 07 11 15 14 13 09 05 01
• Example 2:
• Input: 2
• Matrix:
01 02 03 04 05 06 07 08
09 10 11 12 13 14 15 16
17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32
33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48
49 50 51 52 53 54 55 56
57 58 59 60 61 62 63 64
• Output the Two Coils as:
- Coil1: 36 28 20 21 22 30 38 46 54 63 52 51 50 42 34 26 18 10 02 03 04 05 06 07 08 16 24 32 40 48 56 64
- Coil2: 29 37 45 44 43 35 27 19 11 12 13 14 15 23 31 39 47 55 63 62 61 60 59 58 57 49 41 33 25 17 09 01| Report Duplicate | Flag | PURGE
Yahoo Developer Program Engineer Arrays
in php
- kumar.prince6 April 26, 2015i have given same solu but they told me how to break my code
- kumar.prince6 April 11, 2013We consider a Permutation of first 'N' natural numbers 'good' if it doesn't have 'x' and 'x+1' appearing consecutively, where (1 <= x <= N).
For Example, For N=3, all 'good' permutations are:
1. {1,3,2}
2. {2,1,3}
3. {3,2,1}
full qs is
yeah
- kumar.prince6 February 12, 2013class TreeNode {
int data;
TreeNode left;
TreeNode right;
public TreeNode(int data)
{
this.data = data;
left = right =null;
}
}
/**
* Actual Calculation is implemented in calcDiff(root) where the root node is
* passed.
*
*/
class Calc {
public static void main(String [] args)
{
TreeNode root = new TreeNode(1);
root.left = new TreeNode(2);
root.right = new TreeNode(3);
root.left.left = new TreeNode(4);
root.left.right = new TreeNode(5);
root.right.left = new TreeNode(6);
root.right.right = new TreeNode(7);
System.out.println(diff(root));
}
public static int diff(TreeNode n) {
return sumtree(n, 1);
}
public static int sumtree(TreeNode n, int level) {
if (n == null) return 0;
if (level % 2 == 0) {
return sumtree(n.left, level + 1) + sumtree(n.right, level +1 ) - n.data;
} else {
return sumtree(n.left, level + 1) + sumtree(n.right, level + 1) + n.data;
}
}
}
above code is correct but whats is complexity
anybody can explain
class Node {
int data;
Node next;
public Node(int data) {
this.data = data;
}
}
public class MergeList {
public static void main(String[] args) {
Node root = new Node(1);
root.next = new Node(2);
root.next.next = new Node(3);
root.next.next.next = new Node(4);
root.next.next.next.next = new Node(5);
root.next.next.next.next.next = new Node(1);
root.next.next.next.next.next.next = new Node(2);
//root.next.next.next.next.next.next.next = new Node(2);
Node temp = findMax(root);
//System.out.println(":::::" + temp.data);
Node temp1 = temp.next;
temp.next = null;
Node head = MergeLists(root, temp1);
while (head!=null) {
//System.out.println(" ");
System.out.print(head.data);
head = head.next;
}
}
static Node MergeLists(Node list1, Node list2) {
if (list1 == null) {
return list2;
}
if (list2 == null) {
return list1;
}
Node head;
if (list1.data <= list2.data) {
head = list1;
} else {
head = list2;
list2 = list1;
list1 = head;
}
while(list1.next != null && list2 != null) {
if (list1.next.data <= list2.data) {
list1 = list1.next;
} else {
Node tmp = list1.next;
list1.next = list2;
list2 = tmp;
}
}
if (list1.next == null) {
list1.next = list2;
}
return head;
}
public static Node merge(Node h1, Node h2) {
Node h3 = new Node(0);
Node current = h3;
boolean isH1Left = false;
boolean isH2Left = false;
while (h1 != null || h2 != null) {
if (h1.data <= h2.data) {
current.next = h1;
h1 = h1.next;
} else {
current.next = h2;
h2 = h2.next;
}
current = current.next;
if (h2 == null && h1 != null) {
isH1Left = true;
break;
}
if (h1 == null && h2 != null) {
isH2Left = true;
break;
}
}
if (isH1Left) {
while (h1 != null) {
current.next = h1;
current = current.next;
h1 = h1.next;
}
}
if (isH2Left) {
while (h2 != null) {
current.next = h2;
current = current.next;
h2 = h2.next;
}
}
h3 = h3.next;
return h3;
}
public static Node findMax(Node max) {
while (max.next != null) {
if (max.data > max.next.data)
break;
max = max.next;
}
return max;
}
public static Node findMin(Node min) {
Node max = findMax(min);
if(max.next.data < min.data)
return min;
else
return max.next;
}
}
hi thanks a bunch for helping
- kumar.prince6 January 11, 2013thanks a bunch for sol
- kumar.prince6 November 11, 2012
[custom_options]
- kumar.prince6 April 26, 20151.if [custom_options] is ""
2.if [custom_options] is not "" then count