What do you want to save?
Add Code snippet
New code examples
-
Other 2022-02-19 20:10:04
what is the use of sentinels in merge sort
The use of sentinels in merge sort prevents us from needing to check to see if we have reached the end of either of the arrays being sorted. Merge sort can be performed without a sentinel, but an implementation of merge sort without a sentinel adds an add... Add solution -
TypeScript 2022-02-13 21:40:02
python get list elements missing in one list
list1 = ['1.1.1.1/24', '2.2.2.2/24', '3.3.3.3/24', '4.4.4.4/24'] list2 = ['3.3.3.3/24', '4.4.4.4/24', '5.5.5.5/24', '6.6.6.6/24'] set1 = set(list1) set2 = set(list2) missing = list(sorted(set1 - set2)) added = list(sorted(set2 - set1)) print('missing:'... Add solution -
Javascript 2022-02-13 18:35:21
how the sort function works javascript
const unsorted = ['d', 'd', 'h', 'r', 'v', 'z', 'f', 'c', 'g']; const sorted = unsorted.sort(); console.log(sorted); //["c", "d", "d", "f", "g", "h", "r", "v", "z"]... Add solution -
Javascript 2022-02-02 21:10:18
bash sort json alphabetically
jq --sort-keys . my_file > sorted_file Add solution -
Python 2022-02-02 05:47:06
sort array python
my_list = [9, 3, 1, 5, 88, 22, 99] # sort in decreasing order my_list = sorted(my_list, reverse=True) print(my_list) # sort in increasing order my_list = sorted(my_list, reverse=False) print(my_list) # another way to sort using built-in methods my_li... Add solution