From 0f4c67813f41c0790301f6d09a5b1c75b9e2238a Mon Sep 17 00:00:00 2001 From: 100yo Date: Sat, 30 Nov 2024 05:03:51 +0200 Subject: [PATCH] Add Lambdas & Stream API code snippets --- 08-lambdas-and-stream-api/snippets/README.md | 1 + .../bg/sofia/uni/fmi/mjt/MethRefExample.java | 50 +++++ .../sofia/uni/fmi/mjt/employees/Employee.java | 74 +++++++ .../fmi/mjt/employees/EmployeesExample.java | 33 ++++ .../fmi/mjt/gatherers/GatherersExample.java | 42 ++++ .../bg/sofia/uni/fmi/mjt/ints/IntsSum.java | 19 ++ .../sofia/uni/fmi/mjt/peaks/PeakExplorer.java | 185 ++++++++++++++++++ .../sofia/uni/fmi/mjt/peaks/model/Peak.java | 26 +++ .../uni/fmi/mjt/peaks/resources/mountains.txt | 118 +++++++++++ 9 files changed, 548 insertions(+) create mode 100644 08-lambdas-and-stream-api/snippets/README.md create mode 100644 08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/MethRefExample.java create mode 100644 08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/employees/Employee.java create mode 100644 08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/employees/EmployeesExample.java create mode 100644 08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/gatherers/GatherersExample.java create mode 100644 08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/ints/IntsSum.java create mode 100644 08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/peaks/PeakExplorer.java create mode 100644 08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/peaks/model/Peak.java create mode 100644 08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/peaks/resources/mountains.txt diff --git a/08-lambdas-and-stream-api/snippets/README.md b/08-lambdas-and-stream-api/snippets/README.md new file mode 100644 index 00000000..6e94bc2e --- /dev/null +++ b/08-lambdas-and-stream-api/snippets/README.md @@ -0,0 +1 @@ +# Ламбда изрази и Stream API diff --git a/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/MethRefExample.java b/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/MethRefExample.java new file mode 100644 index 00000000..efd89b7b --- /dev/null +++ b/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/MethRefExample.java @@ -0,0 +1,50 @@ +package bg.sofia.uni.fmi.mjt; + +import java.util.function.Function; +import java.util.function.IntConsumer; +import java.util.function.Supplier; + +public class MethRefExample { + + public MethRefExample() { + System.out.println("No arg constructor invoked"); + } + + public MethRefExample(String s) { + System.out.println("String arg constructor invoked with param " + s); + } + + public static void fun() { + System.out.println("fun() invoked"); + } + + public static void fun(int i) { + System.out.println("fun(int) invoked with argument " + i); + } + + public static void main(String[] args) { + + // method reference to overloaded constructor + Function stringConstructorRef1 = MethRefExample::new; + Function stringConstructorRef2 = s -> new MethRefExample(s); + MethRefExample example1 = stringConstructorRef1.apply("FMI"); + MethRefExample example2 = stringConstructorRef1.apply("Rulez"); + + Supplier defaultConstructorRef = MethRefExample::new; + MethRefExample example3 = defaultConstructorRef.get(); + + // method reference to overloaded methods + IntConsumer methRef1 = MethRefExample::fun; + methRef1.accept(5); + + NoArgNoReturn methRef2 = MethRefExample::fun; + methRef2.accept(); + + } + + @FunctionalInterface + interface NoArgNoReturn { + void accept(); + } + +} diff --git a/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/employees/Employee.java b/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/employees/Employee.java new file mode 100644 index 00000000..e0b7706f --- /dev/null +++ b/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/employees/Employee.java @@ -0,0 +1,74 @@ +package bg.sofia.uni.fmi.mjt.employees; + +import java.util.Objects; + +public class Employee { + + private int id; + private String name; + private int age; + private double salary; + private double bonus; + + public Employee(int id, String name, int age, double salary, double bonus) { + this.id = id; + this.name = name; + this.age = age; + this.salary = salary; + this.bonus = bonus; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + public double getSalary() { + return salary; + } + + public void setSalary(double salary) { + this.salary = salary; + } + + public double getBonus() { + return bonus; + } + + public void setBonus(double bonus) { + this.bonus = bonus; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Employee employee = (Employee) o; + return id == employee.id; + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + +} diff --git a/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/employees/EmployeesExample.java b/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/employees/EmployeesExample.java new file mode 100644 index 00000000..efe1cb24 --- /dev/null +++ b/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/employees/EmployeesExample.java @@ -0,0 +1,33 @@ +package bg.sofia.uni.fmi.mjt.employees; + +import java.util.List; + +public class EmployeesExample { + + public static void main(String... args) { + Employee e1 = new Employee(1, "Бай Кольо", 56, 1200.00, 340.00); + Employee e2 = new Employee(2, "Шефа", 43, 15000.00, 30000.00); + Employee e3 = new Employee(3, "Стажанта", 20, 850.00, 0.00); + + List employees = List.of(e1, e2, e3); + + System.out.println(getEmployeeSalariesTotal(employees)); + } + + public static double getEmployeeSalariesTotal(List employees) { + // Stream -> reduce -> V + // + // initial value (identity): the initial value of the reduction and the default result if the stream is empty + // accumulator: This is a BinaryOperator function that takes two parameters: + // a partial result of the reduction operation and the next element of the stream + // combiner: combine the results of the accumulator function when processing elements in parallel + // The combiner is necessary in parallel operations, where the input stream is divided into + // multiple sub-streams that are processed independently and then the partial results + // are combined into a final result. + return employees.parallelStream() + .reduce( + 0.0, // initial value + (res, el) -> res + el.getSalary(), // accumulator + (left, right) -> left + right); // combiner + } +} diff --git a/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/gatherers/GatherersExample.java b/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/gatherers/GatherersExample.java new file mode 100644 index 00000000..67cc87dd --- /dev/null +++ b/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/gatherers/GatherersExample.java @@ -0,0 +1,42 @@ +package bg.sofia.uni.fmi.mjt.gatherers; + +import java.util.List; +import java.util.stream.Gatherers; +import java.util.stream.Stream; + +public class GatherersExample { + + // Stream Gatherers is a Java 22 & 23 preview feature + // They allow writing custom intermediate operations + + public static void main(String[] args) { + + // Fold example: factorial + // Similar to the terminal "reduce" but returns a stream of its single-element result + Stream.of(1, 2, 3, 4, 5) // ⟵ Source + .gather(Gatherers.fold(() -> 1, (a, b) -> a * b)) // ⟵ Intermediate operation + .forEach(System.out::println); // ⟵ Terminal operation + + var words = List.of("the", "be", "two", "of", "and", "a", "in", "that"); + System.out.println(words); + + // Fixed window example + var wordGroupsFixed = words.stream() // ⟵ Source + .gather(Gatherers.windowFixed(3)) // ⟵ Intermediate operation + .toList(); // ⟵ Terminal operation + System.out.println(wordGroupsFixed); + + // Sliding window example + var wordGroupsSliding = words.stream() // ⟵ Source + .gather(Gatherers.windowSliding(3)) // ⟵ Intermediate operation + .toList(); // ⟵ Terminal operation + System.out.println(wordGroupsSliding); + + // Map concurrent example: leveraging virtual threads + Stream.of(1, 2, 3, 4, 5) + .gather(Gatherers.mapConcurrent(4, a -> a * 2)) + .forEach(System.out::println); + + } + +} diff --git a/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/ints/IntsSum.java b/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/ints/IntsSum.java new file mode 100644 index 00000000..8cb4e6bf --- /dev/null +++ b/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/ints/IntsSum.java @@ -0,0 +1,19 @@ +package bg.sofia.uni.fmi.mjt.ints; + +import java.util.Set; + +public class IntsSum { + + public static void main(String... args) { + Set numbers = Set.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + + int sumOf5 = numbers + .stream() + .limit(5) + .mapToInt(Integer::intValue) + .sum(); + + System.out.println(sumOf5); // what will be the result? + } + +} diff --git a/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/peaks/PeakExplorer.java b/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/peaks/PeakExplorer.java new file mode 100644 index 00000000..42127889 --- /dev/null +++ b/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/peaks/PeakExplorer.java @@ -0,0 +1,185 @@ +package bg.sofia.uni.fmi.mjt.peaks; + +import bg.sofia.uni.fmi.mjt.peaks.model.Peak; + +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.io.Reader; +import java.io.UncheckedIOException; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +public class PeakExplorer { + + private final List peaks; + + public PeakExplorer(Reader dataInput) { + var reader = new BufferedReader(dataInput); + peaks = reader.lines().map(Peak::of).toList(); + } + + private static void optionalUsageExample(Optional optionalPeakName) { + System.out.println("Optional peak name is empty: " + optionalPeakName.isEmpty()); + System.out.println("Optional peak name is present: " + optionalPeakName.isPresent()); + System.out.println("Peak name: " + optionalPeakName.get()); + } + + public static void main(String... args) throws FileNotFoundException { + PeakExplorer peakExplorer = + new PeakExplorer(new FileReader("./src/bg/sofia/uni/fmi/mjt/peaks/resources/mountains.txt")); + + System.out.println("Count of peaks higher than n: " + peakExplorer.countPeaksTallerThan(5000)); + + System.out.println("Get the lowest peak not being ascended: " + peakExplorer.shortestNotAscended()); + + System.out.println("Get average ascents in top n peaks: " + peakExplorer.avgAscentsTopN(20)); + + System.out.println("Highest ascended peek for year: " + peakExplorer.getHighestAscentForYear(1960)); + + /* + System.out.println("Highest ascended peek for year: " + + peakExplorer.getHighestAscentForYear(2024)); // should result in IllegalArgumentException + */ + + System.out.println( + "Peaks with not Himalaya names by prominence: " + peakExplorer.getNonHimalayaNamesByProminence()); + + System.out.println( + "Get the mountain range which has the most peaks in top n: " + peakExplorer.getRangeWithMostPeaks(20)); + + System.out.println("Get the year with most first ascents: " + peakExplorer.getYearWithMostFirstAscents()); + + System.out.println("Get the earliest ascended peaks: " + peakExplorer.getEarliestAscendedPeaks(5)); + + // Optional example + System.err.println("Optional should be present"); + Optional optionalPeakName1 = peakExplorer.getPeakAscendedInYearWithHighestProminence(1960); + optionalUsageExample(optionalPeakName1); + + System.err.println("Optional should not be present"); + Optional optionalPeakName2 = peakExplorer.getPeakAscendedInYearWithHighestProminence(2024); + // optionalUsageExample(optionalPeakName2); // this results in java.util.NoSuchElementException + } + + public List getPeaks() { + return peaks; + } + + /** + * Определя броя на върховете, които са по-високи от N метра + */ + public long countPeaksTallerThan(int n) { + return peaks.stream() + .filter(peak -> peak.height() > n) + .count(); + } + + /** + * Определя височината на най-ниския връх, който никога не е бил изкачван + */ + public double shortestNotAscended() { + return peaks.stream() + .filter(peak -> peak.firstAscent() == 0) + .mapToDouble(Peak::height) + .min() + .getAsDouble(); + } + + /** + * Определя средния брой изкачвания на върховете в топ N (включително) + * Връща 0.0, ако няма изкачен връх в интервала. + */ + public double avgAscentsTopN(int n) { + return peaks.stream() + .filter(peak -> peak.pos() <= n) + .mapToInt(Peak::totalAscents) + .average() + .orElse(0); + } + + /** + * Определя най-високия връх, изкачен за пръв път през дадена година. + * Ако няма върхове, изкачени през тази година, се хвърля java.lang.IllegalArgumentException. + */ + public Peak getHighestAscentForYear(int year) { + return peaks.stream() + .filter(p -> p.firstAscent() == year) + .max(Comparator.comparingDouble(Peak::height)) + .orElseThrow(() -> new IllegalArgumentException("No peaks have been ascended in " + year)); + } + + /** + * Определя имената на върховете, които не са част от Хималаите + * (която и да е планина, съдържащa 'Himalaya' в името си), + * подредени по изпъкналост (от най-висок към най-нисък) + */ + public List getNonHimalayaNamesByProminence() { + return peaks.stream() + .filter(p -> !p.range().contains("Himalaya")) + .sorted(Comparator.comparing(Peak::prominence).reversed()) + .map(Peak::name) + .toList(); + } + + /** + * Определя името на планинската верига, която има най-много върхове в топ N (включително) + * Ако няколко планински вериги имат равен резултат, няма значение името на коя от тях ще се върне. + */ + public String getRangeWithMostPeaks(int n) { + Map result = + peaks.stream() + .filter(p -> p.pos() <= n) + .collect(Collectors.groupingBy(Peak::range, Collectors.counting())); + + return result.entrySet().stream() + .max(Map.Entry.comparingByValue()) + .get() + .getKey(); + } + + /** + * Определя броя на върховете, които са били изкачени за първи път през всяка отделна година и + * след това връща годината, в която има най-много изкачени върхове. + */ + public int getYearWithMostFirstAscents() { + Map result = + peaks.stream() + .collect(Collectors.groupingBy(Peak::firstAscent, Collectors.counting())); + + return result.entrySet().stream() + .max(Map.Entry.comparingByValue()) + .get() + .getKey(); + } + + /** + * Определя n-те най-рано изкачени върха и връща имената им като един-единствен String, + * разделени със запетаи + */ + public String getEarliestAscendedPeaks(int n) { + return peaks.stream() + .filter(p -> p.firstAscent() > 0) + .sorted(Comparator.comparing(Peak::firstAscent)) + //.peek(System.out::println) + .limit(n) + .map(Peak::name) + .collect(Collectors.joining(", ")); + } + + /** + * Определя името на върха с най-голяма изпъкналост, изкачен през конкретна година + */ + public Optional getPeakAscendedInYearWithHighestProminence(int year) { + return peaks.stream() + .filter(p -> p.firstAscent() == year) + .max(Comparator.comparing(Peak::prominence)) + .map(Peak::name); // method of java.util.Optional + // do not confuse it with map() in java.util.stream.Stream + } + +} diff --git a/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/peaks/model/Peak.java b/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/peaks/model/Peak.java new file mode 100644 index 00000000..44c8a694 --- /dev/null +++ b/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/peaks/model/Peak.java @@ -0,0 +1,26 @@ +package bg.sofia.uni.fmi.mjt.peaks.model; + +/** + * Record, който съхранява информация за един връх от mountains.txt + * + * @param pos - Позиция по височина - мястото по височина на съответния връх + * @param name - Име (на върха) + * @param height - Височина (в метри) + * @param prominence - Изпъкналост (в метри) - показва височината на върха от най-високата седловина, + * свързваща го с по-висок връх) (виж Topographic prominence) + * @param range - Планина – от коя планинска верига е част върхът + * @param firstAscent - Година на първо изкачване + * @param totalAscents - Брой изкачвания след 2004 г. + */ +public record Peak(int pos, String name, double height, double prominence, String range, int firstAscent, + int totalAscents) { + + private static final String PEAK_ATTRIBUTE_DELIMITER = ","; + + public static Peak of(String line) { + final String[] tokens = line.split(PEAK_ATTRIBUTE_DELIMITER); + return new Peak(Integer.parseInt(tokens[0]), tokens[1], Double.parseDouble(tokens[2]), + Double.parseDouble(tokens[3]), tokens[4], Integer.parseInt(tokens[5]), Integer.parseInt(tokens[6])); + } + +} diff --git a/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/peaks/resources/mountains.txt b/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/peaks/resources/mountains.txt new file mode 100644 index 00000000..fd2553c6 --- /dev/null +++ b/08-lambdas-and-stream-api/snippets/src/bg/sofia/uni/fmi/mjt/peaks/resources/mountains.txt @@ -0,0 +1,118 @@ +1,Mount Everest,8848.0,8848.0,Mahalangur Himalaya,1953,121 +2,K2,8611.0,4017.0,Baltoro Karakoram,1954,44 +3,Kangchenjunga,8586.0,3922.0,Kangchenjunga Himalaya,1955,24 +4,Lhotse,8516.0,610.0,Mahalangur Himalaya,1956,26 +5,Makalu,8485.0,2386.0,Mahalangur Himalaya,1955,52 +6,Cho Oyu,8188.0,2340.0,Mahalangur Himalaya,1954,28 +7,Dhaulagiri I,8167.0,3357.0,Dhaulagiri Himalaya,1960,39 +8,Manaslu,8163.0,3092.0,Manaslu Himalaya,1956,45 +9,Nanga Parbat,8126.0,4608.0,Nanga Parbat Himalaya,1953,67 +10,Annapurna I,8091.0,2984.0,Annapurna Himalaya,1950,47 +11,Gasherbrum I / Hidden Peak / K5,8080.0,2155.0,Baltoro Karakoram,1958,16 +12,Broad Peak / K3,8051.0,1701.0,Baltoro Karakoram,1957,19 +13,Gasherbrum II / K4,8035.0,1524.0,Baltoro Karakoram,1956,12 +14,Shishapangma,8027.0,2897.0,Jugal Himalaya,1964,19 +15,Gyachung Kang,7952.0,700.0,Mahalangur Himalaya,1964,3 +110,Gasherbrum III,7946.0,355.0,Baltoro Karakoram,1975,2 +16,Annapurna II,7937.0,2437.0,Annapurna Himalaya,1960,19 +17,Gasherbrum IV,7932.0,715.0,Baltoro Karakoram,1958,11 +18,Himalchuli,7893.0,1633.0,Manaslu Himalaya,1960,12 +19,Distaghil Sar,7884.0,2525.0,Hispar Karakoram,1960,5 +20,Ngadi Chuli,7871.0,1020.0,Manaslu Himalaya,1970,6 +111,Nuptse,7864.0,319.0,Mahalangur Himalaya,1961,12 +21,Khunyang Chhish,7823.0,1765.0,Hispar Karakoram,1971,6 +22,Masherbrum / K1,7821.0,2457.0,Masherbrum Karakoram,1960,9 +23,Nanda Devi,7816.0,3139.0,Garhwal Himalaya,1936,12 +24,Chomo Lonzo,7804.0,590.0,Mahalangur Himalaya,1954,1 +25,Batura Sar,7795.0,3118.0,Batura Karakoram,1976,6 +26,Kanjut Sar,7790.0,1690.0,Hispar Karakoram,1959,1 +27,Rakaposhi,7788.0,2818.0,Rakaposhi-Haramosh Karakoram,1958,13 +28,Namcha Barwa,7782.0,4106.0,Assam Himalaya,1992,2 +29,Kamet,7756.0,2825.0,Garhwal Himalaya,1931,14 +30,Dhaulagiri II,7751.0,2396.0,Dhaulagiri Himalaya,1971,11 +31,Saltoro Kangri / K10,7742.0,2160.0,Saltoro Karakoram,1962,1 +32,Jannu,7711.0,1036.0,Kangchenjunga Himalaya,1962,12 +33,Tirich Mir,7708.0,3910.0,Hindu Kush,1950,11 +112,Molamenqing,7703.0,430.0,Langtang Himalaya,1981,0 +34,Gurla Mandhata,7694.0,2788.0,Nalakankar Himalaya,1985,4 +35,Saser Kangri I / K22,7672.0,2304.0,Saser Karakoram,1973,4 +36,Chogolisa,7665.0,1624.0,Masherbrum Karakoram,1975,2 +113,Dhaulagiri IV,7661.0,469.0,Dhaulagiri Himalaya,1975,10 +37,Kongur Tagh,7649.0,3585.0,Kongur Shan (Eastern Pamirs),1981,4 +114,Dhaulagiri V,7618.0,340.0,Dhaulagiri Himalaya,1975,3 +38,Shispare,7611.0,1240.0,Batura Karakoram,1974,1 +39,Trivor,7577.0,980.0,Hispar Karakoram,1960,5 +40,Gangkhar Puensum,7570.0,2995.0,Kula Kangri Himalaya,0,3 +41,Gongga Shan / Minya Konka,7556.0,3642.0,Daxue Shan (Hengduan Shan),1932,7 +42,Annapurna III,7555.0,703.0,Annapurna Himalaya,1961,17 +43,Muztagh Ata,7546.0,2735.0,Muztagata (Eastern Pamirs),1956,0 +44,Skyang Kangri,7545.0,1085.0,Baltoro Karakoram,1976,2 +45,Changtse,7543.0,520.0,Mahalangur Himalaya,1982,9 +46,Kula Kangri,7538.0,1650.0,Kula Kangri Himalaya,1986,2 +47,Kongur Tiube,7530.0,840.0,Kongur Shan (Eastern Pamirs),1956,3 +48,Mamostong Kangri,7516.0,1803.0,Rimo Karakoram,1984,0 +49,Saser Kangri II E,7513.0,1450.0,Saser Karakoram,2011,0 +50,Ismoil Somoni Peak,7495.0,3402.0,Pamir (Akademiya Nauk Range),1933,178 +51,Saser Kangri III,7495.0,850.0,Saser Karakoram,1986,0 +52,Noshaq,7492.0,2024.0,Hindu Kush,1960,3 +53,Pumari Chhish,7492.0,890.0,Hispar Karakoram,1979,2 +54,Passu Sar,7476.0,645.0,Batura Karakoram,1994,0 +55,Yukshin Gardan Sar,7469.0,1313.0,Hispar Karakoram,1984,1 +56,Teram Kangri I,7462.0,1702.0,Siachen Karakoram,1975,0 +57,Jongsong Peak,7462.0,1298.0,Kangchenjunga Himalaya,1930,3 +58,Malubiting,7458.0,2193.0,Rakaposhi-Haramosh Karakoram,1971,6 +59,Gangapurna,7455.0,563.0,Annapurna Himalaya,1965,13 +60,Jengish Chokusu / Tömür / Pk Pobeda,7439.0,4148.0,Tian Shan,1938,123 +115,Sunanda Devi,7434.0,260.0,Garhwal Himalaya,1939,12 +61,K12,7428.0,1978.0,Saltoro Karakoram,1974,2 +62,Yangra / Ganesh I,7422.0,2352.0,Ganesh Himalaya,1955,6 +63,Sia Kangri,7422.0,640.0,Siachen Karakoram,1934,0 +64,Momhil Sar,7414.0,980.0,Hispar Karakoram,1964,6 +65,Kabru N,7412.0,780.0,Kangchenjunga Himalaya,1994,2 +66,Skil Brum,7410.0,1152.0,Baltoro Karakoram,1957,1 +67,Haramosh Peak,7409.0,2277.0,Rakaposhi-Haramosh Karakoram,1958,3 +68,Istor-o-Nal,7403.0,1040.0,Hindu Kush,1969,5 +69,Ghent Kangri,7401.0,1493.0,Saltoro Karakoram,1961,0 +70,Ultar,7388.0,700.0,Batura Karakoram,1996,5 +71,Rimo I,7385.0,1438.0,Rimo Karakoram,1988,3 +72,Churen Himal,7385.0,600.0,Dhaulagiri Himalaya,1970,0 +73,Teram Kangri III,7382.0,520.0,Siachen Karakoram,1979,0 +74,Sherpi Kangri,7380.0,1000.0,Saltoro Karakoram,1976,1 +75,Labuche Kang,7367.0,1957.0,Labuche Himalaya,1987,0 +76,Kirat Chuli,7362.0,1168.0,Kangchenjunga Himalaya,1939,6 +116,Abi Gamin,7355.0,217.0,Garhwal Himalaya,1950,2 +77,Nangpai Gosum,7350.0,500.0,Mahalangur Himalaya,1996,1 +117,Gimmigela / The Twins,7350.0,432.0,Kangchenjunga Himalaya,1994,1 +78,Saraghrar,7349.0,1979.0,Hindu Kush,1959,3 +79,Jomolhari,7326.0,2077.0,Jomolhari Himalaya,1937,0 +80,Chamlang,7321.0,1240.0,Mahalangur Himalaya,1961,1 +81,Chongtar,7315.0,1300.0,Baltoro Karakoram,1994,1 +82,Baltoro Kangri,7312.0,1200.0,Masherbrum Karakoram,1976,0 +83,Siguang Ri,7309.0,650.0,Mahalangur Himalaya,1989,1 +84,The Crown / Huang Guan,7295.0,1919.0,Yengisogat Karakoram,1993,3 +85,Gyala Peri,7294.0,2942.0,Assam Himalaya,1986,0 +86,Porong Ri,7292.0,520.0,Langtang Himalaya,1982,0 +87,Baintha Brakk / The Ogre,7285.0,1891.0,Panmah Karakoram,1977,13 +88,Yutmaru Sar,7283.0,620.0,Hispar Karakoram,1980,1 +89,Baltistan Peak / K6,7282.0,1962.0,Masherbrum Karakoram,1970,3 +90,Kangpenqing / Gang Benchhen,7281.0,1340.0,Baiku Himalaya,1982,1 +91,Muztagh Tower,7276.0,1710.0,Baltoro Karakoram,1956,2 +92,Mana Peak,7272.0,730.0,Garhwal Himalaya,1937,3 +118,Dhaulagiri VI,7268.0,485.0,Dhaulagiri Himalaya,1970,0 +93,Diran,7266.0,1325.0,Rakaposhi-Haramosh Karakoram,1968,8 +94,Labuche Kang III / East,7250.0,570.0,Labuche Himalaya,0,0 +95,Putha Hiunchuli,7246.0,1151.0,Dhaulagiri Himalaya,1954,5 +96,Apsarasas Kangri,7245.0,635.0,Siachen Karakoram,1976,0 +97,Mukut Parbat,7242.0,840.0,Garhwal Himalaya,1951,1 +98,Rimo III,7233.0,615.0,Rimo Karakoram,1985,0 +99,Langtang Lirung,7227.0,1525.0,Langtang Himalaya,1978,13 +100,Karjiang,7221.0,880.0,Kula Kangri Himalaya,0,2 +101,Annapurna Dakshin,7219.0,775.0,Annapurna Himalaya,1964,16 +102,Khartaphu,7213.0,712.0,Mahalangur Himalaya,1935,0 +103,Tongshanjiabu,7207.0,1757.0,Lunana Himalaya,0,0 +104,Malangutti Sar,7207.0,515.0,Hispar Karakoram,1985,0 +105,Noijin Kangsang / Norin Kang,7206.0,2160.0,Nagarze Himalaya,1986,1 +106,Langtang Ri,7205.0,650.0,Langtang Himalaya,1981,0 +107,Kangphu Kang,7204.0,1200.0,Lunana Himalaya,2002,0 +108,Singhi Kangri,7202.0,790.0,Siachen Karakoram,1976,0 +109,Lupghar Sar,7200.0,730.0,Hispar Karakoram,1979,0 \ No newline at end of file