随笔分类 -  Java 练习题总结

摘要:For a given string you should remove all HTML tags from it. An HTML tag starts with the symbol "<" and ends with the symbol ">". You should output the 阅读全文
posted @ 2020-08-22 12:25 longlong6296 阅读(95) 评论(0) 推荐(0)
摘要:The first line of the input contains a sequence of letters. The second line of the input contains some text. Your task is to determine if any of these 阅读全文
posted @ 2020-08-21 13:24 longlong6296 阅读(166) 评论(0) 推荐(0)
摘要:An IP address consists of four numbers from 0 to 255, inclusive, divided by the dots. For example, 127.0.0.1 is a valid IP address, but 256.0.0.1 and 阅读全文
posted @ 2020-08-21 11:38 longlong6296 阅读(135) 评论(0) 推荐(0)
摘要:Earlier, we defined edit distance as the minimal number of insertions, deletions and substitutions required to transform one string into another. But 阅读全文
posted @ 2020-08-18 07:52 longlong6296 阅读(219) 评论(0) 推荐(0)
摘要:Write a program that reads several descending sorted sequences of ints and merges them into one sequence. The merged sequence should be also sorted in 阅读全文
posted @ 2020-08-17 08:04 longlong6296 阅读(215) 评论(0) 推荐(0)
摘要:Implement a method to find the second largest number in an array of ints. If the input array is empty or contains only a single number, the method mus 阅读全文
posted @ 2020-08-16 11:36 longlong6296 阅读(126) 评论(0) 推荐(0)
摘要:Implement a method that finds the index of the K-th element equal to the minimum in an array of ints. If no such element can be found, return -1. The 阅读全文
posted @ 2020-08-16 11:05 longlong6296 阅读(104) 评论(0) 推荐(0)
摘要:Write a program that sorts a given sequence of characters in the ascending order. A sequence may include only the following characters: 'a', 'b', 'c', 阅读全文
posted @ 2020-08-15 15:42 longlong6296 阅读(95) 评论(0) 推荐(0)
摘要:Implement a method to sort a given array of ints using counting sort. The method should process numbers from -10 to 20 inclusive. Note: the method mus 阅读全文
posted @ 2020-08-15 14:06 longlong6296 阅读(143) 评论(0) 推荐(0)
摘要:Write a program that counts the number of required shifts to sort the numbers in the descending order using insertion sort. By shift, we mean the case 阅读全文
posted @ 2020-08-15 12:20 longlong6296 阅读(185) 评论(0) 推荐(0)
摘要:Let's say that an array is max-min sorted if the first element of the array is the maximum element, the second is the minimum, the third is the second 阅读全文
posted @ 2020-08-15 08:29 longlong6296 阅读(207) 评论(0) 推荐(0)
摘要:Count how many comparisons you need to do to determine the index of the element, or to determine that this element is not in the array. You need to us 阅读全文
posted @ 2020-08-14 17:31 longlong6296 阅读(183) 评论(0) 推荐(0)
摘要:The method described in the theory performs binary search for arrays sorted in ascending order. Your task here is to modify the method such that: it a 阅读全文
posted @ 2020-08-14 09:43 longlong6296 阅读(143) 评论(0) 推荐(0)
摘要:Implement a method to search the count of occurrence values from the first array in the second one. The method must return an array of counts with the 阅读全文
posted @ 2020-08-14 07:44 longlong6296 阅读(96) 评论(0) 推荐(0)
摘要:Implement a method to count the number of occurrences of a value in an array of int's. Sample Input 1: 19 14 17 15 17 17 Sample Output 1: 2 Sample Inp 阅读全文
posted @ 2020-08-14 07:29 longlong6296 阅读(94) 评论(0) 推荐(0)
摘要:Write a program that reads a year and the number of a month (1-12) and prints dates of all Mondays of this month in the correct order (from the first 阅读全文
posted @ 2020-08-13 12:45 longlong6296 阅读(128) 评论(0) 推荐(0)
摘要:A user inputs a long number M. You need to find out what is the smallest long *n*, so that *n*! >= *M*. Use the BigInteger class to solve the problem. 阅读全文
posted @ 2020-08-13 09:09 longlong6296 阅读(95) 评论(0) 推荐(0)
摘要:Each number can be broken down into parts, or addends. For example, number 3 may be broken down into such addends as 1 + 1 + 1, 2 + 1, 3. This procedu 阅读全文
posted @ 2020-08-12 13:13 longlong6296 阅读(161) 评论(0) 推荐(0)
摘要:Write a method named addValueByIndex. The method should take an array of longs and add value to the specified element by its index. Here is a descript 阅读全文
posted @ 2020-08-12 09:54 longlong6296 阅读(166) 评论(0) 推荐(0)
摘要:Write a method that tests the given number is composite or not. The composite number is a positive integer that has at least one divisor other than 1 阅读全文
posted @ 2020-08-12 08:16 longlong6296 阅读(99) 评论(0) 推荐(0)