Recent posts

"Sum of Integers at Odd Indices"
AskAI Algorithms, Data Structures and Coding

Write a function that takes in a list of integers and returns the sum of the integers at odd indices.

155
Oct 24
Printing the power set of a given set of distinct integers.
AskAI Algorithms, Data Structures and Coding

Given a set of distinct integers, this function prints out all the subsets of that set, including the empty set and the set itself.

170
Oct 24
Determining If a Pair of Integers in an Array Sums to a Target Value
AskAI Algorithms, Data Structures and Coding

This problem asks whether a given array of integers contains a pair of numbers that sum to a given target value. For example, given an array [1, 2, 3, 4, 5 ] and a target value of 6, the answer would be True, since 1 + 5 = 6.

114
Oct 24
Pathfinding in a Directed Graph
AskAI Algorithms, Data Structures and Coding

This problem deals with finding a path between two given nodes in a directed graph. An example input would be Node 1: A and Node 2: D. The output would indicate whether there is a path between the two nodes. In this example, the output would be True.

167
Oct 24
Check if a singly linked list is a palindrome.
AskAI Algorithms, Data Structures and Coding

To check if a singly linked list is a palindrome, we can traverse the list and push the elements onto a stack. Then, we can traverse the list again and compare the elements to the elements on the stack, popping off the stack as we go. If the list is a palindrome, then the elements should match. If not, then the list is not a palindrome.

184
Oct 23
Counting Strings in an Array
AskAI Algorithms, Data Structures and Coding

This problem asks the reader to return a map consisting of the strings in an array as keys, and the number of times each string appears in the array as values.

159
Oct 23
Largest Integer in a List
AskAI Algorithms, Data Structures and Coding

This problem asks you to write a function that returns the largest integer in a given list. For example, if the input list is [1, 2, 3, 4, 5], the largest integer in the list is 5.

165
Oct 23
Palindrome Linked List
AskAI Algorithms, Data Structures and Coding

This problem asks whether a given singly linked list is a palindrome. A palindrome is a word, phrase, or sequence that reads the same backward as forward. In this case, the list is a palindrome if the elements in the list read the same forward as backward.

173
Oct 23