SortedSet

3 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€85.26
List Price:  €119.36
You save:  €34.10
£73.50
List Price:  £102.91
You save:  £29.40
CA$136.63
List Price:  CA$191.29
You save:  CA$54.65
A$153.90
List Price:  A$215.47
You save:  A$61.56
S$127.88
List Price:  S$179.04
You save:  S$51.15
HK$784.91
List Price:  HK$1,098.91
You save:  HK$313.99
CHF 79.72
List Price:  CHF 111.61
You save:  CHF 31.89
NOK kr1,013.09
List Price:  NOK kr1,418.36
You save:  NOK kr405.27
DKK kr636.08
List Price:  DKK kr890.54
You save:  DKK kr254.45
NZ$166.69
List Price:  NZ$233.38
You save:  NZ$66.68
د.إ367.26
List Price:  د.إ514.18
You save:  د.إ146.92
৳12,273.16
List Price:  ৳17,182.92
You save:  ৳4,909.75
₹8,587.28
List Price:  ₹12,022.54
You save:  ₹3,435.25
RM423.45
List Price:  RM592.85
You save:  RM169.40
₦153,062.69
List Price:  ₦214,293.89
You save:  ₦61,231.20
₨28,403.29
List Price:  ₨39,765.75
You save:  ₨11,362.45
฿3,260.02
List Price:  ฿4,564.16
You save:  ฿1,304.14
₺3,998.39
List Price:  ₺5,597.91
You save:  ₺1,599.51
B$542.04
List Price:  B$758.88
You save:  B$216.84
R1,774.73
List Price:  R2,484.69
You save:  R709.96
Лв166.54
List Price:  Лв233.16
You save:  Лв66.62
₩136,889.26
List Price:  ₩191,650.45
You save:  ₩54,761.18
₪333.71
List Price:  ₪467.20
You save:  ₪133.49
₱5,666.23
List Price:  ₱7,932.95
You save:  ₱2,266.72
¥14,541.63
List Price:  ¥20,358.87
You save:  ¥5,817.23
MX$1,871.77
List Price:  MX$2,620.55
You save:  MX$748.78
QR365.67
List Price:  QR511.95
You save:  QR146.28
P1,325.25
List Price:  P1,855.40
You save:  P530.15
KSh12,918.70
List Price:  KSh18,086.70
You save:  KSh5,168
E£4,967.64
List Price:  E£6,954.89
You save:  E£1,987.25
ብር13,885.93
List Price:  ብር19,440.87
You save:  ብር5,554.93
Kz91,186.38
List Price:  Kz127,664.58
You save:  Kz36,478.20
CLP$93,038.69
List Price:  CLP$130,257.89
You save:  CLP$37,219.20
CN¥717.25
List Price:  CN¥1,004.19
You save:  CN¥286.93
RD$5,988.17
List Price:  RD$8,383.68
You save:  RD$2,395.51
DA12,961.67
List Price:  DA18,146.86
You save:  DA5,185.18
FJ$225
List Price:  FJ$315.01
You save:  FJ$90.01
Q769.28
List Price:  Q1,077.02
You save:  Q307.74
GY$20,931.81
List Price:  GY$29,305.38
You save:  GY$8,373.56
ISK kr12,141.78
List Price:  ISK kr16,998.98
You save:  ISK kr4,857.20
DH898.01
List Price:  DH1,257.26
You save:  DH359.24
L1,669.84
List Price:  L2,337.85
You save:  L668
ден5,246.25
List Price:  ден7,344.96
You save:  ден2,098.71
MOP$808.96
List Price:  MOP$1,132.57
You save:  MOP$323.61
N$1,759.94
List Price:  N$2,463.99
You save:  N$704.04
C$3,681.74
List Price:  C$5,154.59
You save:  C$1,472.84
रु13,662.37
List Price:  रु19,127.86
You save:  रु5,465.49
S/354.77
List Price:  S/496.69
You save:  S/141.92
K413.28
List Price:  K578.61
You save:  K165.32
SAR375
List Price:  SAR525.02
You save:  SAR150.01
ZK2,423.77
List Price:  ZK3,393.37
You save:  ZK969.60
L431.82
List Price:  L604.57
You save:  L172.74
Kč2,098.29
List Price:  Kč2,937.69
You save:  Kč839.40
Ft34,043.57
List Price:  Ft47,662.36
You save:  Ft13,618.79
SEK kr952.20
List Price:  SEK kr1,333.12
You save:  SEK kr380.92
ARS$112,338.76
List Price:  ARS$157,278.76
You save:  ARS$44,940
Bs691.38
List Price:  Bs967.96
You save:  Bs276.58
COP$399,789.51
List Price:  COP$559,721.32
You save:  COP$159,931.80
₡50,528.66
List Price:  ₡70,742.15
You save:  ₡20,213.48
L2,614.10
List Price:  L3,659.85
You save:  L1,045.74
₲797,359.95
List Price:  ₲1,116,335.83
You save:  ₲318,975.88
$U4,013.06
List Price:  $U5,618.44
You save:  $U1,605.38
zł362.08
List Price:  zł506.92
You save:  zł144.84
Already have an account? Log In

Transcript

Hello in this Java programming tutorial, we are going to look at the sorted set collection. So it is basically built on top of a regular set and a preset preset is a way of organizing for regular sets. The list of items are in order and the sorted set. You don't have to create another subset to organize your existing set. It just organizes itself no matter what order you add the elements in. And to use it you just need to import Java dot util like so.

And now we're going to do is create a new preset and then we need to add you know the data to the set You know, 78 is still the same in that concrete duplicates in there. But we're over the phone, beef cleanly on in order. Now this is printed, overdue, sorted, sorted. Everything is in order, even though we didn't manually do that ourselves, which is really cool. So if you know you want to use a set, and you want it to be an order all the time, just use a sorted set. Okay, let me show you how to sort of go over each one.

You can use a iterator, iterator because that sorted iterator and we just do loyal dot has next. So while there's still another item that he can go through, we just do object element object equality because I got next like so. So this is just gonna get the next element will printer printer and just putting in here there we go. That's how we would get the element one by one if we wanted to the variety of other methods as well that you can use on a sorted set. I will provide a link to that with this video. So feel free to check that out.

That's it. Thanks for watching. If you have any question feel free to reach out and I I look forward to seeing you in the next awesome Java video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.