instruction_seed
stringlengths
0
26.4k
source
stringclasses
4 values
Develop an algorithm for shuffling an array of numbers.
codefeedback
Create an algorithm to solve the Tower of Hanoi problem.
codefeedback
Modify the code to return the most repeated character. def max_repeated_char(input_string): char_count = dict() max_count = 0 max_char = None for char in input_string: if char not in char_count: char_count[char] = 1 else: char_count[char] += 1 pri...
codefeedback
Calculate the minimum value of the following set of numbers: 4, -2, 6, 9.
codefeedback
Create a C# function that takes 2 input strings and returns true if one string is a permutation of the other.
codefeedback
Write some C code to print the following pattern:
codefeedback
Write a code that finds all the prime numbers from 1 to n.
codefeedback
Find the longest increasing subsequence of a given array of numbers. [10,22,9,33,21,50,41,60]
codefeedback
Create a program in python to find the longest common contiguous subarray between two integers. int arr1[7] = {1,2,4,4,4,4,7} int arr2[5] = {1,4,4,5,5}
codefeedback
Construct an algorithm in python to find the length of the longest common substring between two strings str1 = "'abbcdefg" str2 = "zabxdefujh"
codefeedback
You need to compute the sum of all odd elements in a given matrix. [[1, 2, 3], [4, 5, 6], [7, 8, 9],]
codefeedback
Write a function to compute the product of all elements in a matrix. [[1, 2, 3], [4, 5, 6], [7, 8, 9],]
codefeedback
Write a SQL query to delete the record of a person whose id is 1234.
codefeedback
Design an algorithm to check if a number is a palindrome. 7337
codefeedback
Create a JavaScript regex to match an email address.
codefeedback
Create a MySQL query to calculate the median of a column in a table.
codefeedback
Create an object-oriented design in Python to represent a customer.
codefeedback
Create a function that takes a string and returns the first letter of each word in the string. string = "This is an example"
codefeedback
Find the maximum element in a Binary Search Tree.
codefeedback
Create a dictionary comprehension to capture all the words in a sentence. The quick brown fox jumps over the lazy dog
codefeedback
Develop a Java method to calculate the square root of a given number n.
codefeedback
Implement a quick-sort algorithm in Python to sort a given array in ascending order.
codefeedback
Create an SQL query that finds the average number of orders for each customer over the last year.
codefeedback
Create a distributed system using Python
codefeedback
Create a neural network using TensorFlow.
codefeedback
Write a Python program to implement a text-based game
codefeedback
Analyze the sentiment of this statement using Python. I am truly happy with the amazing results
codefeedback
Create a SQL query to return the names of all customers sorted in descending order by their balance?
codefeedback
Modify the following code to turn it into an Insertion Sort algorithm. def sort_numbers(arr): pass
codefeedback
Compute the maximum of the following integers using Java. [6, 3, 8, 4, 7]
codefeedback
Write a C# program to calculate the area of a triangle.
codefeedback
Create an assembler program to count the number of vowels in a given string.
codefeedback
Find the time complexity for the folllowing function. def myFunc(n): product = 1 for i in range(2, n+1): product *= i return product
codefeedback
Create a Chrome extension that highlights hyperlinks in green.
codefeedback
Convert the following if-else scenerio into switch statements. if (x == 1) { y = 10; } else if (x == 2) { y = 20; } else if (x == 3) { y = 30; }
codefeedback
Write a query to select all artworks whose titles starting with a 'C'.
codefeedback
Use PHP to convert a given number to binary.
codefeedback
Write a SQL query to find all the customers whose order total is greater than 1000.
codefeedback
Output the ASCII character corresponding to the decimal value 65.
codefeedback
Calculate the maximum product of two numbers in a list. [4, -2, 3, -1]
codefeedback
Create a function to calculate the sum of the Triangle Series up to the given number n.
codefeedback
Create a list comprehension to generate the first 10 Fibonacci numbers.
codefeedback
Write an SQL query to retrieve the names of all the people in the Users table who are over the age of 25.
codefeedback
Write a SQL query to get the titles and release dates of all the movies from the Movies table released in the year 2019.
codefeedback
Create a function in C++ that capitalizes the first letter of every word in a given string.
codefeedback
Find any two numbers in an array such that their sum is equal to a given value. array = [3, 4, 5, 6, 7, 8] value = 11
codefeedback
Given a string s and a character c, create a new string with all the occurrences of c in s removed. s = 'caat' c = 'a'
codefeedback
Create a function that reverses the elements of a given array
codefeedback
Calculate the total number of possible binary trees with n nodes.
codefeedback
Implement a class that stores values of all data types.
codefeedback
Implement a method to find the shortest path between two points in a two-dimensional array using Dijkstra's algorithm. The two-dimensional array: [[1, 8, 3], [4, 5, 6], [9, 5, 0]] Start point: [0, 0] End point: [2, 2]
codefeedback
Construct a C program to print all permutations of a given string.
codefeedback
Create a function to remove specified nodes from a linked list. Linked List: 10 -> 21 -> 14 -> 35 -> 19 -> 63 -> null Node: 14
codefeedback
Create a Java program to convert an array of integers into an integer. [1,2,3,4]
codefeedback
Write a function in Python to convert a given decimal number into its binary form.
codefeedback
Implement a function in Python that takes an array of numbers and returns the index of the maximum element. [4,7,9,2,10]
codefeedback
Find the maximum value from a Python dictionary. sample_dict = {'a': 10, 'b': 20, 'c': 40, 'd': 30}
codefeedback
Create a program that prints out an Egyptian multiplication table up to twelve
codefeedback
Write code for sorting an array in-place.
codefeedback
Create a code to find all prime numbers between 2 and a given integer.
codefeedback
Generate a code that concatenates a reversed copy of a given string to itself. Python
codefeedback
Replace the "TODO" with the appropriate code for implementing a binary search algorithm in Python. # TODO
codefeedback
Use the given function to detect if a given string is a palindrome.
codefeedback
Create a function to generate a list of all prime numbers in a given range.
codefeedback
What is the output of the following code? list1 = [1, 2, 3] list2 = list1 list1[0] = 'a'
codefeedback
Construct a program to remove leading zeros from a string. '00abc'
codefeedback
What are the differences between a class and an object?
codefeedback
Create a MySQL statement to find the row with the lowest value in a column "Price".
codefeedback
Write a Java program to find the 10 numbers closest to the given number. 50
codefeedback
Create a C++ function to print all possible paths from top left to bottom right of a MxN matrix.
codefeedback
What is the purpose of an immutable object in Python?
codefeedback
Determine the sum of the squares of all even numbers in a given array. [1, 2, 3, 4, 5, 6]
codefeedback
Write a Python code snippet to calculate the area of a triangle with side lengths 3, 4, and 5.
codefeedback
What is the time complexity of insertion sort algorithm in big O notation?
codefeedback
Design a data structure using JavaScript to represent a binary tree.
codefeedback
Write a function in Java to check if a given string is a palindrome (a word, phrase, or sequence that reads the same backward as forward).
codefeedback
Write a JavaScript code snippet for validating an email address.
codefeedback
Construct a boolean expression using 'or', 'and' and 'not' operators to check if a given number is even.
codefeedback
Identify the standard algorithm used to solve the following problem. Problem: DNA sequencing
codefeedback
Identify the correct regular expression for a string that starts with a letter and is followed by any number of letters and numbers. -
codefeedback
Perform a web scraping to retrieve the prices of a specific product. Website: www.amazon.com Product: iPhone 12
codefeedback
Create a Recursive Function to print out the Fibonacci numbers. Number: 10
codefeedback
Describe an algorithm to sort an array of integers in increasing order. [4, 3, 1, 9, 11]
codefeedback
Given two string parameters, s1 and s2, construct a function that returns the longest common subsequence between the two strings. s1 = "Hello there!" s2 = "Hi there!"
codefeedback
Create an algorithm to generate all possible subsets of a given set of elements.
codefeedback
Create a function to determine the output of def my_func(x): if x == 0: return 1 else: return x * my_func(x-1) x = 5
codefeedback
Our program should accept an arbitrary number of integers and output a list of the largest number from each. 1 2 3 4 5
codefeedback
Given a 2D array, write a program to find the maximum path sum. test_array = [[5, 6, 1], [4, 2, 3], [7, 8, 9]]
codefeedback
Create an algorithm to reverse a linked list in place.
codefeedback
Write a function in JavaScript to print the Fibonacci sequence up to the given number.
codefeedback
Write a code snippet for generating a random number between 1 and 100.
codefeedback
Explain the importance and use of an algorithm in computing.
codefeedback
Create a method to calculate the area of a circle, given its radius as argument.
codefeedback
Write a function to rotate a matrix by 90 degrees.
codefeedback
Write an SQL query to select the most recent 5 orders for each customer. customers: id name city 1 John Paris 2 Adam London 3 David Paris 4 Mary Tokyo orders: id customer_id date 1 1 2020-02-20 2 1 2020-03-15 3 2 2020-02-09 4 2 2020-0...
codefeedback
Write a JavaScript function to generate all possible combinations of a given set of elements.
codefeedback
How would you write a SQL query to select all customers who have placed more than two orders?
codefeedback
Search in the API documentation to find all possible parameters that can be used with the API call.
codefeedback
Add error handling to the code snippet. def calculate_average(numbers): sum = 0 for number in numbers: sum += number return sum/len(numbers)
codefeedback
Find the Big O notation of the following code def factorial(n): answer = 1 for i in range(1, n+1): answer *= i return answer
codefeedback