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
€87.14
List Price:  €122
You save:  €34.86
£75.29
List Price:  £105.41
You save:  £30.12
CA$137.33
List Price:  CA$192.27
You save:  CA$54.93
A$141.80
List Price:  A$198.53
You save:  A$56.72
S$128.26
List Price:  S$179.57
You save:  S$51.31
HK$783.27
List Price:  HK$1,096.61
You save:  HK$313.34
CHF 79.54
List Price:  CHF 111.36
You save:  CHF 31.82
NOK kr958.19
List Price:  NOK kr1,341.51
You save:  NOK kr383.31
DKK kr651.09
List Price:  DKK kr911.55
You save:  DKK kr260.46
NZ$171.92
List Price:  NZ$240.70
You save:  NZ$68.77
د.إ367.21
List Price:  د.إ514.11
You save:  د.إ146.90
৳12,287.30
List Price:  ৳17,202.71
You save:  ৳4,915.41
₹9,325.70
List Price:  ₹13,056.36
You save:  ₹3,730.65
RM393.91
List Price:  RM551.49
You save:  RM157.58
₦136,279.37
List Price:  ₦190,796.57
You save:  ₦54,517.20
₨27,955.36
List Price:  ₨39,138.62
You save:  ₨11,183.26
฿3,286.67
List Price:  ฿4,601.47
You save:  ฿1,314.80
₺4,431.56
List Price:  ₺6,204.36
You save:  ₺1,772.80
B$524.65
List Price:  B$734.54
You save:  B$209.88
R1,691.56
List Price:  R2,368.26
You save:  R676.69
Лв170.44
List Price:  Лв238.62
You save:  Лв68.18
₩149,919.27
List Price:  ₩209,892.98
You save:  ₩59,973.70
₪311.64
List Price:  ₪436.31
You save:  ₪124.66
₱6,013.19
List Price:  ₱8,418.71
You save:  ₱2,405.51
¥15,910.69
List Price:  ¥22,275.60
You save:  ¥6,364.91
MX$1,779.28
List Price:  MX$2,491.07
You save:  MX$711.78
QR365.84
List Price:  QR512.19
You save:  QR146.35
P1,364.45
List Price:  P1,910.29
You save:  P545.83
KSh12,958.70
List Price:  KSh18,142.70
You save:  KSh5,184
E£5,222.91
List Price:  E£7,312.29
You save:  E£2,089.37
ብር15,710.10
List Price:  ብር21,994.78
You save:  ብር6,284.67
Kz91,203.97
List Price:  Kz127,689.21
You save:  Kz36,485.24
CLP$91,407.85
List Price:  CLP$127,974.65
You save:  CLP$36,566.80
CN¥689.98
List Price:  CN¥966
You save:  CN¥276.02
RD$6,082.91
List Price:  RD$8,516.33
You save:  RD$2,433.41
DA13,238.41
List Price:  DA18,534.30
You save:  DA5,295.89
FJ$221.85
List Price:  FJ$310.60
You save:  FJ$88.75
Q767.07
List Price:  Q1,073.94
You save:  Q306.86
GY$20,949.93
List Price:  GY$29,330.74
You save:  GY$8,380.81
ISK kr12,478.75
List Price:  ISK kr17,470.75
You save:  ISK kr4,992
DH941.49
List Price:  DH1,318.13
You save:  DH376.63
L1,752.37
List Price:  L2,453.39
You save:  L701.02
ден5,371.73
List Price:  ден7,520.65
You save:  ден2,148.91
MOP$808.41
List Price:  MOP$1,131.81
You save:  MOP$323.39
N$1,679.42
List Price:  N$2,351.26
You save:  N$671.83
C$3,679.63
List Price:  C$5,151.64
You save:  C$1,472
रु14,857.69
List Price:  रु20,801.36
You save:  रु5,943.67
S/343.57
List Price:  S/481.02
You save:  S/137.44
K434.10
List Price:  K607.76
You save:  K173.66
SAR375.47
List Price:  SAR525.67
You save:  SAR150.20
ZK1,958.19
List Price:  ZK2,741.54
You save:  ZK783.35
L444.15
List Price:  L621.83
You save:  L177.68
Kč2,135.46
List Price:  Kč2,989.72
You save:  Kč854.26
Ft34,228.72
List Price:  Ft47,921.58
You save:  Ft13,692.86
SEK kr939.65
List Price:  SEK kr1,315.54
You save:  SEK kr375.89
ARS$139,437.37
List Price:  ARS$195,217.90
You save:  ARS$55,780.52
Bs691.96
List Price:  Bs968.77
You save:  Bs276.81
COP$371,588.45
List Price:  COP$520,238.70
You save:  COP$148,650.24
₡46,992.08
List Price:  ₡65,790.80
You save:  ₡18,798.71
L2,655.43
List Price:  L3,717.71
You save:  L1,062.28
₲647,191.03
List Price:  ₲906,093.33
You save:  ₲258,902.30
$U4,049.61
List Price:  $U5,669.62
You save:  $U1,620
zł372.90
List Price:  zł522.07
You save:  zł149.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.