Showing 0-0 of 0 results
# Exercise Title Features Description Platform Keywords
1 Review - Contains A Free Coding Problem Coding Question CodeWorkout review, String, recursion, char, length
2 Length of Line Code Completion Complete the following function that computes the length of a line segment with end points (x1, y1) and (x2, y2).... CodeCheck Fundamental Data Types
3 String Length String Length AnnEx strings
4 Run-Length Encoding Code Completion A simple technique for compressing an image is run-length encoding. The color of each pixel or area is specified for... CodeCheck Loops
5 Laughing length in C++ Free Coding Problem, code writing Coding Question CodeWorkout for, loop, iteration, code writing
6 Path lengths in binary tree Code Completion Your task is to compute a set of all path lengths in a binary tree. For example, given this tree, CodeCheck Tree Structures
7 Run lengths Code Completion A run is a sequence of adjacent repeated values. For example, the array with elements CodeCheck Arrays and Array Lists
8 (Strings) String length - CSEdPad Given a string, this program finds out the length of a string. AnnEx string
9 DEPRECATED_String Length Java BehaviorExample for demonstrating DEPRECATED_String Length AnnEx
10 CFG Exercise: Odd length Grammar Construction Exercise User creates a CFG that generates strings in the language a^nb^m where m - n is positive, odd. OpenDSA Context-Free Grammar
11 DFA Exercise: Length a Multiple of 3 with No aab Automata Construction Exercise User creates a DFA that recognizes strings with length a multiple of 3 and containing no instance of aab. OpenDSA Context-Free Grammar
12 Map word lengths to words Code Completion Given an array of strings, create a tree map whose keys are the string lengths and whose values are the... CodeCheck Tree Structures
13 Average word length Code Completion Complete the following program to compute the average length of the words. Invoke the appropriate method to compute the length... CodeCheck Objects
14 Repeat where the row lengths don't have to match. Code Completion Repeat where the row lengths don't have to match. Fill the shorter array with zeroes. CodeCheck Two-Dimensional Arrays, Producing 2D Arrays
15 Map words to their lengths Code Completion Given an array of strings, create a tree map with each string as a key and its corresponding value the... CodeCheck Tree Structures
16 Repeat where the row lengths don't have to match. Code Completion Repeat where the row lengths don't have to match. Fill the shorter array with zeroes. CodeCheck Two-Dimensional Arrays, Producing 2D Arrays
17 Given a list of integers of length ≥ 4, return the average of the first two and last two elements. Code Completion Given a list of integers of length ≥ 4, return the average of the first two and last two elements. CodeCheck Lists - Simple Exercises, No loops
18 Given a list of integers of length ≥ 3, return the average of the first, last, and middle element (or the two middle elements if the length is even). Code Completion Given a list of integers of length ≥ 3, return the average of the first, last, and middle element (or... CodeCheck Lists - Simple Exercises, No loops
19 Given an array of integers of length ≥ 4, return the average of the first two and last two elements. Code Completion Given an array of integers of length ≥ 4, return the average of the first two and last two elements. CodeCheck Arrays - Simple Exercises, No loops
20 Given an array of integers of length ≥ 3, return the average of the first, last, and middle element (or the two middle elements if the length is even). Code Completion Given an array of integers of length ≥ 3, return the average of the first, last, and middle element (or... CodeCheck Arrays - Simple Exercises, No loops
21 Given two lists of integers a and b of the same length, count the number of positions where the lists have the same elements. Code Completion Given two lists of integers a and b of the same length, count the number of positions where the lists... CodeCheck Lists - Simple Exercises, Counting Elements
22 Given two lists of integers a and b of the same length, count the number of positions where the list elements differ by at least 2. Code Completion Given two lists of integers a and b of the same length, count the number of positions where the list... CodeCheck Lists - Simple Exercises, Counting Elements
23 Given two lists of integers of the same length, return the first position where their elements are the same. Code Completion Given two lists of integers of the same length, return the first position where their elements are the same. CodeCheck Lists - Simple Exercises, Finding Elements
24 Given two lists of integers of the same length, return the first position where their elements differ. Code Completion Given two lists of integers of the same length, return the first position where their elements differ. CodeCheck Lists - Simple Exercises, Finding Elements
25 Given a string s and a character c (as string of length 1), return a string with the characters surrounding the first occurrence of c reversed. Code Completion Given a string s and a character c (as string of length 1), return a string with the characters surrounding... CodeCheck Strings, Other String Operations
26 Given a string s and a character c (as string of length 1), return a string with the characters surrounding any occurrence of c reversed. Code Completion Given a string s and a character c (as string of length 1), return a string with the characters surrounding... CodeCheck Strings, Other String Operations
27 Given two arrays of integers of the same length, return the first position where their elements are the same. Code Completion Given two arrays of integers of the same length, return the first position where their elements are the same. CodeCheck Arrays - Simple Exercises, Finding Elements
28 Given two arrays of integers of the same length, return the first position where their elements differ. Code Completion Given two arrays of integers of the same length, return the first position where their elements differ. CodeCheck Arrays - Simple Exercises, Finding Elements
29 Given two arrays of integers a and b of the same length, count the number of positions where the array elements differ by at least 2. Code Completion Given two arrays of integers a and b of the same length, count the number of positions where the array... CodeCheck Arrays - Simple Exercises, Counting Elements
30 Given two arrays of integers a and b of the same length, count the number of positions where the arrays have the same elements. Code Completion Given two arrays of integers a and b of the same length, count the number of positions where the arrays... CodeCheck Arrays - Simple Exercises, Counting Elements
31 Given an integer n, return a list of length n containing 1 -1 1 -1 . Code Completion Given an integer n, return a list of length n containing 1 -1 1 -1 ... CodeCheck Lists - Simple Exercises, Filling
32 Given a string and two characters x and y (as strings of length 1), interchange all occurrences of x and y. Code Completion Given a string and two characters x and y (as strings of length 1), interchange all occurrences of x and... CodeCheck Strings, Other String Operations
33 Given an integer n, fill an array of length n with 1 -1 1 -1 . Code Completion Given an integer n, fill an array of length n with 1 -1 1 -1 ... CodeCheck Arrays - Simple Exercises, Filling
34 Given a list of integers, return a list of lists of length 2, containing each unique element together with its frequency. Code Completion Given a list of integers, return a list of lists of length 2, containing each unique element together with its... CodeCheck Lists - Simple Exercises, Double Loops
35 Given integers n and k, return a list of length n containing 0 1 2 . Code Completion Given integers n and k, return a list of length n containing 0 1 2 ... k-1 0 1 2... CodeCheck Lists - Simple Exercises, Filling
36 Given a string, return the string with the middle two characters removed if it has even length, and the middle character removed if it has odd length. Code Completion Given a string, return the string with the middle two characters removed if it has even length, and the middle... CodeCheck Strings, No Loops
37 Given a string, return the string with the middle two characters swapped if it has even length, and the middle three characters swapped if it has odd length. Code Completion Given a string, return the string with the middle two characters swapped if it has even length, and the middle... CodeCheck Strings, No Loops
38 Given a list of strings and a string s, return the average length of all strings containing s. Code Completion Given a list of strings and a string s, return the average length of all strings containing s. CodeCheck Lists - Simple Exercises, Sums, Averages, Products
39 Given a list of integers, give the largest n ≤ length / 2 so that the sum of the first n elements equals the sum of the last n elements. Code Completion Given a list of integers, give the largest n ≤ length / 2 so that the sum of the first... CodeCheck Lists - Simple Exercises, Sums, Averages, Products
40 Given a list of integers, return a list of length 2 containing the first and last element, in sorted order. Code Completion Given a list of integers, return a list of length 2 containing the first and last element, in sorted order. CodeCheck Lists - Simple Exercises, Two Answers
41 Given a list of integers, return a list of length 2 containing the minimum and the maximum. Code Completion Given a list of integers, return a list of length 2 containing the minimum and the maximum. CodeCheck Lists - Simple Exercises, Two Answers
42 Given a list of integers, return a list of length 2, with the number of positive and the number of negative elements in the list. Code Completion Given a list of integers, return a list of length 2, with the number of positive and the number of... CodeCheck Lists - Simple Exercises, Two Answers
43 Given a list of integers, return a list of length 2, each being a list. Code Completion Given a list of integers, return a list of length 2, each being a list. The first one holds the... CodeCheck Lists - Simple Exercises, Two Answers
44 Given a list of integers, return a list of length 2, each being a list. Code Completion Given a list of integers, return a list of length 2, each being a list. The first one holds the... CodeCheck Lists - Simple Exercises, Two Answers
45 Given a string, return the string with the middle two characters swapped if it has even length, and the middle three characters swapped if it has odd length. Code Completion Given a string, return the string with the middle two characters swapped if it has even length, and the middle... CodeCheck Strings, No Loops
46 Given a string, return the string with the middle two characters removed if it has even length, and the middle character removed if it has odd length. Code Completion Given a string, return the string with the middle two characters removed if it has even length, and the middle... CodeCheck Strings, No Loops
47 Given an array of strings and a string s, return the average length of all strings containing s. Code Completion Given an array of strings and a string s, return the average length of all strings containing s. CodeCheck Arrays - Simple Exercises, Sums, Averages, Products
48 Given an array of integers, give the largest n ≤ length / 2 so that the sum of the first n elements equals the sum of the last n elements. Code Completion Given an array of integers, give the largest n ≤ length / 2 so that the sum of the first... CodeCheck Arrays - Simple Exercises, Sums, Averages, Products
49 Given an array of integers, return an array of length 2 containing the first and last element, in sorted order. Code Completion Given an array of integers, return an array of length 2 containing the first and last element, in sorted order. CodeCheck Arrays - Simple Exercises, Two Answers
50 Given an array of integers, return an array of length 2, with the number of positive and the number of negative elements in the array. Code Completion Given an array of integers, return an array of length 2, with the number of positive and the number of... CodeCheck Arrays - Simple Exercises, Two Answers
51 Given an array of integers, return an array of length 2, each being an array. Code Completion Given an array of integers, return an array of length 2, each being an array. The first one holds the... CodeCheck Arrays - Simple Exercises, Two Answers
52 Given an array of integers, return an array of length 2, each being an array. Code Completion Given an array of integers, return an array of length 2, each being an array. The first one holds the... CodeCheck Arrays - Simple Exercises, Two Answers
53 Given an array of integers, return an array of length 2 containing the minimum and the maximum. Code Completion Given an array of integers, return an array of length 2 containing the minimum and the maximum. CodeCheck Arrays - Simple Exercises, Two Answers
54 Given integers n and k, fill an array of length n with 0 1 2 . Code Completion Given integers n and k, fill an array of length n with 0 1 2 ... k-1 0 1 2... CodeCheck Arrays - Simple Exercises, Filling
55 Given an array of integers, return an array of arrays of length 2, containing each unique element together with its frequency. Code Completion Given an array of integers, return an array of arrays of length 2, containing each unique element together with its... CodeCheck Arrays - Simple Exercises, Double Loops
56 Given a two-dimensional array of integers, return the position of the largest square subarray filled with zeroes, as a list of length 2. Code Completion Given a two-dimensional array of integers, return the position of the largest square subarray filled with zeroes, as a list... CodeCheck Two-Dimensional Arrays, Complex Loops
57 Given a two-dimensional array of integers, return the position of the smallest element in the array as a list of length 2. Code Completion Given a two-dimensional array of integers, return the position of the smallest element in the array as a list of... CodeCheck Two-Dimensional Arrays, Looping Over the Entire Array
58 Given a two-dimensional array of integers and a value x, return the position of the first match as a list of length 2. Code Completion Given a two-dimensional array of integers and a value x, return the position of the first match as a list... CodeCheck Two-Dimensional Arrays, Looping Over the Entire Array
59 Given a two-dimensional array of integers and a value x, return the positions of all matching elements, as a list of arrays of length 2. Code Completion Given a two-dimensional array of integers and a value x, return the positions of all matching elements, as a list... CodeCheck Two-Dimensional Arrays, Looping Over the Entire Array
60 Given two two-dimensional arrays of integers with the same number of rows and columns, return the first position where they do not match, as a list of length 2. Code Completion Given two two-dimensional arrays of integers with the same number of rows and columns, return the first position where they... CodeCheck Two-Dimensional Arrays, Producing 2D Arrays
61 Given a two-dimensional array of integers and a value x, return the position of the first match as an array of length 2. Code Completion Given a two-dimensional array of integers and a value x, return the position of the first match as an array... CodeCheck Two-Dimensional Arrays, Looping Over the Entire Array
62 Given a two-dimensional array of integers, return the position of the smallest element in the array as an array of length 2. Code Completion Given a two-dimensional array of integers, return the position of the smallest element in the array as an array of... CodeCheck Two-Dimensional Arrays, Looping Over the Entire Array
63 Given a two-dimensional array of integers and a value x, return the positions of all matching elements, as an array of arrays of length 2. Code Completion Given a two-dimensional array of integers and a value x, return the positions of all matching elements, as an array... CodeCheck Two-Dimensional Arrays, Looping Over the Entire Array
64 Given a two-dimensional array of integers, return the position of the largest square subarray filled with zeroes, as an array of length 2. Code Completion Given a two-dimensional array of integers, return the position of the largest square subarray filled with zeroes, as an array... CodeCheck Two-Dimensional Arrays, Complex Loops
65 Given two two-dimensional arrays of integers with the same number of rows and columns, return the first position where they do not match, as an array of length 2. Code Completion Given two two-dimensional arrays of integers with the same number of rows and columns, return the first position where they... CodeCheck Two-Dimensional Arrays, Producing 2D Arrays
66 Given a two-dimensional array of integers and a string N, E, S, W, give the middle element along the border in the given compass direction, or the average of the two middle ones if the border length is even. Code Completion Given a two-dimensional array of integers and a string N, E, S, W, give the middle element along the border... CodeCheck Two-Dimensional Arrays, No Loops
67 Given a two-dimensional array of integers and a string N, E, S, W, give the middle element along the border in the given compass direction, or the average of the two middle ones if the border length is even. Code Completion Given a two-dimensional array of integers and a string N, E, S, W, give the middle element along the border... CodeCheck Two-Dimensional Arrays, No Loops
68 Zipper words with helper method Code Completion Two strings of equal length can be interlaced like the teeth of a zipper to form a new word. For... CodeCheck Recursion
69 Zipper words Code Completion Two strings of equal length can be interlaced like the teeth of a zipper to form a new word. For... CodeCheck Recursion
70 ZipperWordGenerator Code Completion You are given two strings of equal length. Your task is to generate all zipper words that can be produced... CodeCheck Recursion
71 Two-level linear index Slideshow Algorithm Analysis Presentation Slideshow showing a two-level linear index for variable length records stored on disk. OpenDSA Linear Indexing
72 Simple linear index Slideshow Algorithm Visualization Slideshow showing a simple linear index for variable length records stored on disk. OpenDSA Linear Indexing, File Processing
73 (MathClass) MathExample1 - CSEdPad Demonstrate the understanding of Math class concepts by constructing a program that finds the length of the hypotenuse in of... AnnEx math
74 Regular Grammar Exercise: Number of a's and b's is Odd Grammar Construction Exercise User writes an regular grammar for the language of strings with an odd length. OpenDSA Regular Expression, Regular Grammar
75 Turing Machine Exercise: Decide Powers of 2 Automata Construction Exercise User creates a Turing machine that decides if strings of a's have a length that is a power of 2. OpenDSA Turing Machine
76 Remove short words Code Completion Remove all short words (that is, words of length at most 3) from an array. Move down the remaining array... CodeCheck Arrays and Array Lists
77 Middle Letter Code Completion Complete the getMiddle method that gets the middle character from a word if the word length is odd, or the... CodeCheck Branches
78 Pythagorean Theorem (Case 1) Construct a program that accepts two input values from the user, one for each side of a right-angle triangle. The... PCEX arithmetic operations, operators, variables
79 Pythagorean Theorem (Case 2) Suppose that the user provides two input values for a right-angle triangle. The first input is for the length of... PCEX arithmetic operations
80 Reporting File Information (Case 2) Construct a program that receives the full path to an input file from the user, reads that file and reports... PCEX file i/o
81 The Class for Representing a Loan (Case 1) Construct a class that represents a loan. This class should contain data representing the interest rate, loan amount, and the... PCEX classes, objects
82 The Class for Representing a Loan (Case 2) Construct a class that represents a loan. This class should contain data representing the interest rate, loan amount, and the... PCEX classes, objects
83 Pythagorean Theorem (Case 1) Construct a program that accepts two input values from the user, one for each side of a right-angle triangle. The... PCEX
84 Pythagorean Theorem (Case 2) Suppose that the user provides two input values for a right-angle triangle. The first input is for the length of... PCEX
85 Given a string, return the string with the first and second half swapped. Code Completion Given a string, return the string with the first and second half swapped. If the string has odd length, leave... CodeCheck Strings, No Loops
86 Pythagorean Theorem Construct a program that accepts two input values from the user, one for each side of a right-angle triangle. The... PCEX arithmetic operations, arithmetic operators, math, operators, variables
87 The Class for Representing a Loan Construct a class that represents a loan. This class should contain data representing the interest rate, loan amount, and the... PCEX classes, object, objects
88 The Class for Representing a Loan Construct a class that represents a loan. This class should contain data representing the interest rate, loan amount, and the... PCEX classes, objects
89 Reporting File Information Construct a program that receives the full path to an input file from the user, reads that file and reports... PCEX file i/o
90 Pythagorean Theorem Construct a program that accepts two input values from the user, one for each side of a right-angle triangle. The... PCEX operators, variables
91 Pythagorean Theorem (Case 2) Suppose that the user provides two input values for a right-angle triangle. The first input is for the length of... PCEX arithmetic operations, arithmetic operators, data types, operators, variables
92 Reporting File Information (Case 2) Construct a program that receives the full path to an input file from the user, reads that file and reports... PCEX classes, exceptions, file i/o, methods, objects
93 The Class for Representing a Loan (Case 2) Construct a class that represents a loan. This class should contain data representing the interest rate, loan amount, and the... PCEX classes, objects
94 The Class for Representing a Loan Construct a class that represents a loan. This class should contain data representing the interest rate, loan amount, and the... PCEX classes, objects
95 Reporting File Information Construct a program that receives the full path to an input file from the user, reads that file and reports... PCEX exception handling, file i/o
96 Pythagorean Theorem Suppose that the user provides two input values for a right-angle triangle. The first input is for the length of... PCEX operators, variables
97 Letter frequency map Code Completion Your task is to produce a map of the frequencies of all letters in a string. Letters are represented as... CodeCheck Tree Structures
98 Letter set Code Completion Your task is to produce a set of all letters in a string. Letters are represented as strings of length... CodeCheck Tree Structures
99 Letter frequency (count) Code Completion Write a method that computes how often each letter A-Z or a-z occurs in a string. Don't distinguish between upper-... CodeCheck Arrays and Array Lists
100 Number of even and odd elements Code Completion Count the number of even and odd elements in an array of integers. Since you must return two counts, place... CodeCheck Arrays and Array Lists
101 Letter frequency (percentage) Code Completion Write a method that computes the frequency (as a percentage between 0.0 and 1.0) of each letter A-Z or a-z... CodeCheck Arrays and Array Lists
102 Find longest word in file Code Completion Your task is to open a file, read all words in the file, and find the longest word in the... CodeCheck Input and Output
103 Check for Valid Answers Code Completion Consider a program that administers multiple-choice quizzes. The student needs to provide a response such as A or D. Your... CodeCheck Branches
104 Given a string, return the string with the first and second half swapped. Code Completion Given a string, return the string with the first and second half swapped. If the string has odd length, leave... CodeCheck Strings, No Loops
105 Given a two-dimensional array of integers, return the middle element if both the row and column lenghts are odd, or the average of the two or four middle elements of one or both is even. Code Completion Given a two-dimensional array of integers, return the middle element if both the row and column lenghts are odd, or... CodeCheck Two-Dimensional Arrays, No Loops
106 Given a two-dimensional array of integers, return the middle element if both the row and column lenghts are odd, or the average of the two or four middle elements of one or both is even. Code Completion Given a two-dimensional array of integers, return the middle element if both the row and column lenghts are odd, or... CodeCheck Two-Dimensional Arrays, No Loops