Yuqoridagi method ni generic shaklga keltirish uchun qanday shaklda yozishimiz kerak?
Anonymous Quiz
13%
public static <T> List <T> arrayToList(T[] array, List<T> list)
60%
public static List <T> arrayToList(Object[] array, List<T> list)
13%
public static <T> List <T> armatolis(Object[] array, List<Object> list)
13%
public static List <T> arrayToList(T[] array, List<T> list)
π1
T va undan yuqori toifadagi element larni o'z ichiga oluvchi wildcard ni qanday yozsak bo'ladi?
Anonymous Quiz
22%
<T>
16%
<T super>
14%
<super T>
8%
<A super T>
14%
<T super A>
8%
<A extends T>
11%
<T extends A>
8%
To'g'ri javob yo'q
π2
Kun masalasi: 2225. Find Players With Zero or One Losses
Qiyinlik darajasi: Medium
Please open Telegram to view this post
VIEW IN TELEGRAM
LeetCode
Find Players With Zero or One Losses - LeetCode
Can you solve this real interview question? Find Players With Zero or One Losses - You are given an integer array matches where matches[i] = [winneri, loseri] indicates that the player winneri defeated player loseri in a match.
Return a list answer of sizeβ¦
Return a list answer of sizeβ¦
π1
image_2022-11-28_02-07-43.png
263 KB
Please open Telegram to view this post
VIEW IN TELEGRAM
π3
Graphs mavzusi ga kirish qismi tayyor bo'ldi, ya'ni graph nima, u haqida nimalarni bilishimiz kerak, u bilan nimalar qila olamiz, uni qanday kompyuter xotirasida saqlab qolamiz degan savollar o'z javobini topdi In Shaa Alloh.
Savol: Bu graphlar mavzusini o'zi bo'ldi, lekin birorta algorithm o'rgatmadim. Baribir bu video alohida, keyngi yani algoritm darsi alohida video ko'rinishida chiqadi, lekin bitta playlistda. Shunga bu video ni hozir youtube ga qo'yganim ma'qul mi yoki 1 2 ta algoritm larniyam video qilib keyn mi?
Fikringiz juda muhim ovoz bersangiz xursand bo'lardim.
Savol: Bu graphlar mavzusini o'zi bo'ldi, lekin birorta algorithm o'rgatmadim. Baribir bu video alohida, keyngi yani algoritm darsi alohida video ko'rinishida chiqadi, lekin bitta playlistda. Shunga bu video ni hozir youtube ga qo'yganim ma'qul mi yoki 1 2 ta algoritm larniyam video qilib keyn mi?
Fikringiz juda muhim ovoz bersangiz xursand bo'lardim.
β‘1π1
Qaysi biri ma'qul?
Anonymous Poll
50%
Shuni o'zini youtube ga qo'yib turavering
50%
Bir ikkita algoritm qo'shib keyin chiqaring
π3πΎ2
Please open Telegram to view this post
VIEW IN TELEGRAM
LeetCode
Insert Delete GetRandom O(1) - LeetCode
Can you solve this real interview question? Insert Delete GetRandom O(1) - Implement the RandomizedSet class:
* RandomizedSet() Initializes the RandomizedSet object.
* bool insert(int val) Inserts an item val into the set if not present. Returns true ifβ¦
* RandomizedSet() Initializes the RandomizedSet object.
* bool insert(int val) Inserts an item val into the set if not present. Returns true ifβ¦
β‘1π1πΎ1
Please open Telegram to view this post
VIEW IN TELEGRAM
π1
Kun masalasi: 1207. Unique Number of Occurrences
Qiyinlik darajasi: Easy
Qiyinlik darajasi: Easy
LeetCode
Unique Number of Occurrences - LeetCode
Can you solve this real interview question? Unique Number of Occurrences - Given an array of integers arr, return true if the number of occurrences of each value in the array is unique or false otherwise.
Example 1:
Input: arr = [1,2,2,1,1,3]
Output:β¦
Example 1:
Input: arr = [1,2,2,1,1,3]
Output:β¦
π1
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
LeetCode
Determine if String Halves Are Alike - LeetCode
Can you solve this real interview question? Determine if String Halves Are Alike - You are given a string s of even length. Split this string into two halves of equal lengths, and let a be the first half and b be the second half.
Two strings are alike ifβ¦
Two strings are alike ifβ¦
image_2022-12-01_09-25-00.png
181.2 KB
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
LeetCode
Determine if Two Strings Are Close - LeetCode
Can you solve this real interview question? Determine if Two Strings Are Close - Two strings are considered close if you can attain one from the other using the following operations:
* Operation 1: Swap any two existing characters.
* For example, abcdeβ¦
* Operation 1: Swap any two existing characters.
* For example, abcdeβ¦
π4
tg_image_1592388437.jpeg
132.2 KB
Please open Telegram to view this post
VIEW IN TELEGRAM
π2
Qiziqishingiz mumkin yuqoridagi kodda sort ishlatilgan va nima uchun bu kod ning time complexity si
NLogN
emas deb, toβgβri. Sortlash uchun NLogN
. lekin bizdagi array ning hajmi 26 va bu array ni saralash uchun 26*log(26)
. Lekin, buni hisoblab koβrsak 200 dan ham kam bu esa const time hisoblanadi. Unda nima uchun O(1)
boβlmadi deb oβylayotgan boβlsangiz tepadagi 2 ta soβzlarning uzunligi maximum 10Λ5
ekanligi berilgan va biz ularni massiv shakliga keltirib toβliq yurib chiqdik bu esa O(N)
. Shunday qilib: O(N) + O(1) = O(N)
.π4
Har bir thread ning o'zining nomi bor(by default). Biz xohlagan threadimiz uchun o'zimiz xohlagan nomni bera olamizmi?
Anonymous Quiz
64%
ha albatta, myThread.setName(βsome nameβ)
36%
yoβq, har bir thread uchun java o'zi nom qo'yadi, masalan Thread-0, Thread-1 β¦
π1
Yuqoridagi methoddan bir vaqtda faqat bir thread foylanishini qanday ta'minlasa bo'ladi?
Anonymous Quiz
36%
void kalit so'zi oldidan synchronized kalit so'zini yozish kerak
40%
method nomi oldidan synchronized kalit so'zini yozish kerak
20%
buni method ni o'zgartirish orqali amalga oshirib bo'lmaydi
4%
buni umuman iloji yo'q