Santhosh Gowd

Greenhorn
+ Follow
since Nov 28, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Santhosh Gowd

I have modified the code like this to use enhanced for loop:


Still the output is same. How does the enhanced for loop works? Previously i was using iterator.
13 years ago
JavaDoc says about PriorityQueue:
[javadoc]
public class PriorityQueue<E>
extends AbstractQueue<E>
implements Serializable

An unbounded priority queue based on a priority heap. "The elements of the priority queue are ordered according to their natural ordering, or by a Comparator provided at queue construction time, depending on which constructor is used". A priority queue does not permit null elements. A priority queue relying on natural ordering also does not permit insertion of non-comparable objects (doing so may result in ClassCastException). [/javadoc]

Is my constructor wrong or my assumption about Queue construction is wrong?
13 years ago
The problem is while storing into the priorityqueue, not while printing. I am assuming that while storing into the queue, it stores in a sorted manner.
13 years ago
I am using PriorityQueue but it is not giving me exact sorting. This is my code:

But this is sorting this queue of arrays

2 2
1 1
4 3
10 1
2 1

as

1 1
2 1
4 3
10 1
2 2

instead of

1 1
2 1
2 2
4 3
10 1

The same comparator works fine over List sorting. I am not getting whats wrong with PriorityQueue.
13 years ago
I am trying to find least common prefix of suffixes in a string using C. For this i am using simple array of charaacters. The length of a string can be of 100000. I am able to find out the answer, however, i could not do it in stipulated time limit. Will the usage of pointers with arrays decrease the time of execution?
13 years ago
wow that really helps. Thanks! @Bear.
13 years ago
This is my situation- I am navigating between to jsps, and i am calling a method there by a class in between. This method uses a fixed set of key-value pairs. So every time i should initialize this hash map, just like another variable. So this wouldn't be an overhead? as the set of values is a bit large. How does the property file works? It is also loaded each time?
13 years ago
no, i do not need to change these values. the values remain static. Any other way to go? I am processing this data while navigating between two jsp pages.
13 years ago
I have a set of key value pairs. which one is better to use? Hash map or properties file and why? I need to use these key value pairs in a single java class only and the set is a bit large.
13 years ago
I am referring to the windows pop up, created using Javascript. I mean, through Js, we redirect it to some jsp. So on the pop up window we are showing some other jsp.
I have a parent window and a dialogue box inside the parent window. Dialogue box is centered relative to the parent window.

Now, when I restore the parent window, the dialogue box should be automatically centered relative to the new window size. How can i achieve this?

I am using internet explorer 8. Change should reflect in all IE versions.
Will that database be integrated into the installable? I mean, in my ways, i give the database url and access the database, insert, delete, etc.,. How does this derby Db works.?
13 years ago
I want to create a stand alone application using JAVA. It should have some data storing capability, do some calculations etc.,. I have never done a task like this.
I mean it can be installed on different machines, maintain its own data. Simply, like any other applications that we install on our computers.

I need some help regarding this.
13 years ago