Hi
I have a hashtable in wich keys are 9,3,8,4.......7,10,15
wen i sort the keys using vector as:
Vector v = new Vector(hs.keySet());
Collections.sort(v);
now v comes out to be 1,10,15,2,3,4,5....
but i want results after sorting should be:
1,2,3,...,10,15,.....
do suggest how to do it.
Do write code
Thanks'
Atul
2 1312
Hi
I have a hashtable in wich keys are 9,3,8,4.......7,10,15
wen i sort the keys using vector as:
Vector v = new Vector(hs.keySet());
Collections.sort(v);
now v comes out to be 1,10,15,2,3,4,5....
but i want results after sorting should be:
1,2,3,...,10,15,.....
do suggest how to do it.
Do write code
Thanks'
Atul
You're talking about Strings that just *look like* numbers, right?
kind regards,
Jos
Hi
Thanks a lot for ur reply.
Sory I came on post very late.
But I got it from ur answer
Thanks'
atul
You're talking about Strings that just *look like* numbers, right?
kind regards,
Jos
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Pratyush |
last post by:
Hi,
Suppose there is a vector of objects of class A, i.e., std::vector<A>
vec_A(N); The class A satisifies all the STL vector requirements.
Now I wish to add some attributes for each of the...
|
by: cylin |
last post by:
Dear all,
After sorting a vector, how to get max in this vector?
I got a strange result of my test code.
-------------------------------------------------
#include <iostream>
#include <vector>...
|
by: Alex Vinokur |
last post by:
===================================
------------- Sorting -------------
Comparative performance measurement
===================================
Testsuite : Comparing Function Objects to...
|
by: Matthias Kaeppler |
last post by:
Hi,
in my program, I have to sort containers of objects which can be 2000
items big in some cases. Since STL containers are based around copying
and since I need to sort these containers quite...
|
by: fred_stevens |
last post by:
Hi all you C boffins:
I need to sort a vector of doubles is ascending order. Qsort will
return the sorted vector, but I need a vector of the indices of the
sorted vector, not the actual sorted...
|
by: Daz |
last post by:
Hello people!
(This post is best viewed using a monospace font).
I need to create a class, which holds 4 elements:
std::string ItemName
int Calories
int Weight
int Density
|
by: SvenMathijssen |
last post by:
Hi,
I've been wrestling with a problem for some time that ought to be fairly simple, but turns out to be very difficult for me to solve. Maybe someone here knows the answer.
What I try to do is...
|
by: Pino |
last post by:
HI all,
I am learning c++ ( just 1 month) and would want an aid for a code.
I have a integer vector of length N.
ie
3
3
3
4
4
1
|
by: Trent |
last post by:
Running this I see that on first run, both bubble and selection sort have 9
sort counts while insertion sort has ZERO. With a sorted list, should this
be ZERO for all?
Also bsort and Ssort have...
|
by: Tim Frink |
last post by:
Hi,
I need some help with STL lists.
I've a list with pointers to some objects,
let's say std::list< ObjectA* myList.
The objects of the class ObjectA all have a
function "int...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |