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.25
List Price:  €119.35
You save:  €34.10
£73.50
List Price:  £102.91
You save:  £29.40
CA$135.96
List Price:  CA$190.35
You save:  CA$54.39
A$138.83
List Price:  A$194.37
You save:  A$55.54
S$127.39
List Price:  S$178.36
You save:  S$50.96
HK$783.42
List Price:  HK$1,096.82
You save:  HK$313.40
CHF 78.11
List Price:  CHF 109.36
You save:  CHF 31.25
NOK kr929.54
List Price:  NOK kr1,301.40
You save:  NOK kr371.85
DKK kr637.44
List Price:  DKK kr892.45
You save:  DKK kr255
NZ$169.56
List Price:  NZ$237.39
You save:  NZ$67.83
د.إ367.21
List Price:  د.إ514.11
You save:  د.إ146.90
৳12,271.28
List Price:  ৳17,180.29
You save:  ৳4,909
₹9,490.10
List Price:  ₹13,286.52
You save:  ₹3,796.42
RM396.96
List Price:  RM555.76
You save:  RM158.80
₦137,584.24
List Price:  ₦192,623.44
You save:  ₦55,039.20
₨27,874.71
List Price:  ₨39,025.71
You save:  ₨11,151
฿3,252.96
List Price:  ฿4,554.28
You save:  ฿1,301.31
₺4,513.79
List Price:  ₺6,319.49
You save:  ₺1,805.69
B$495.34
List Price:  B$693.49
You save:  B$198.15
R1,670.96
List Price:  R2,339.41
You save:  R668.45
Лв166.84
List Price:  Лв233.59
You save:  Лв66.74
₩147,117.28
List Price:  ₩205,970.08
You save:  ₩58,852.80
₪294.34
List Price:  ₪412.09
You save:  ₪117.75
₱6,126.88
List Price:  ₱8,577.88
You save:  ₱2,450.99
¥15,705.72
List Price:  ¥21,988.64
You save:  ¥6,282.92
MX$1,745.62
List Price:  MX$2,443.94
You save:  MX$698.32
QR364.31
List Price:  QR510.05
You save:  QR145.74
P1,320.52
List Price:  P1,848.79
You save:  P528.26
KSh12,913.70
List Price:  KSh18,079.70
You save:  KSh5,166
E£5,363.43
List Price:  E£7,509.02
You save:  E£2,145.58
ብር15,695.93
List Price:  ብር21,974.93
You save:  ብር6,279
Kz91,790.82
List Price:  Kz128,510.82
You save:  Kz36,720
CLP$89,891.01
List Price:  CLP$125,851.01
You save:  CLP$35,960
CN¥682.75
List Price:  CN¥955.88
You save:  CN¥273.13
RD$5,949.40
List Price:  RD$8,329.40
You save:  RD$2,380
DA13,244.82
List Price:  DA18,543.28
You save:  DA5,298.45
FJ$219.18
List Price:  FJ$306.87
You save:  FJ$87.68
Q764.07
List Price:  Q1,069.73
You save:  Q305.66
GY$20,923.13
List Price:  GY$29,293.23
You save:  GY$8,370.09
ISK kr12,266.77
List Price:  ISK kr17,173.97
You save:  ISK kr4,907.20
DH925.03
List Price:  DH1,295.08
You save:  DH370.05
L1,714.81
List Price:  L2,400.80
You save:  L685.99
ден5,255.92
List Price:  ден7,358.50
You save:  ден2,102.57
MOP$807
List Price:  MOP$1,129.83
You save:  MOP$322.83
N$1,665.83
List Price:  N$2,332.23
You save:  N$666.40
C$3,670.63
List Price:  C$5,139.03
You save:  C$1,468.40
रु15,178.84
List Price:  रु21,250.98
You save:  रु6,072.14
S/350.71
List Price:  S/491.01
You save:  S/140.30
K433.83
List Price:  K607.38
You save:  K173.55
SAR374.96
List Price:  SAR524.95
You save:  SAR149.99
ZK1,884.43
List Price:  ZK2,638.28
You save:  ZK753.84
L443.76
List Price:  L621.28
You save:  L177.52
Kč2,078.46
List Price:  Kč2,909.93
You save:  Kč831.46
Ft30,991.25
List Price:  Ft43,388.99
You save:  Ft12,397.74
SEK kr922.74
List Price:  SEK kr1,291.87
You save:  SEK kr369.13
ARS$139,256.87
List Price:  ARS$194,965.19
You save:  ARS$55,708.32
Bs691.06
List Price:  Bs967.51
You save:  Bs276.45
COP$361,946.03
List Price:  COP$506,738.92
You save:  COP$144,792.89
₡45,468.96
List Price:  ₡63,658.37
You save:  ₡18,189.40
L2,661.73
List Price:  L3,726.53
You save:  L1,064.80
₲624,601.53
List Price:  ₲874,467.13
You save:  ₲249,865.60
$U4,030.02
List Price:  $U5,642.19
You save:  $U1,612.17
zł362.89
List Price:  zł508.07
You save:  zł145.17
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.