Recent posts

Find index of element in sorted array
AskAI Algorithms, Data Structures and Coding

This problem deals with finding the index of an element in a sorted array of integers. The input is a sorted array of integers and an integer value to find. The output is the index of the value in the array, or -1 if the value is not present in the array.

170
Dec 07
Stack Order Checker
AskAI Algorithms, Data Structures and Coding

The function should return true if the stack is in sorted order (increasing order), and false otherwise.

125
Dec 06
Cycles in Undirected Graphs
AskAI Algorithms, Data Structures and Coding

This problem is about detecting cycles in undirected graphs. Given a graph, the function should return true if there is a cycle, and false otherwise.

157
Dec 06
Sum all elements in a list
AskAI Algorithms, Data Structures and Coding

To sum all elements in a list, we can simply iterate through the list and add each element to a running total. This will take O(n) time, where n is the length of the list.

117
Dec 06
Reverse a Linked List Using Recursion
AskAI Algorithms, Data Structures and Coding

This problem involves reversing a linked list using recursion. The given example input is a list of integers, but this technique can be applied to lists of any data type. The output should be the reverse of the input list.

154
Dec 06
Anagrams in a List
AskAI Algorithms, Data Structures and Coding

Given a list of words, this code problem finds all of the anagrams in the list. For example, given the input ["cat", "tac", "act", "dog ", "god", "gdo"], the output would be [["cat", "tac", "act"], ["dog", "god", "gdo"]].

157
Dec 06
Get Second to Last Node in Linked List
AskAI Algorithms, Data Structures and Coding

Write a function that takes a linked list as input and returns the second to last node in the list.

149
Dec 06
Recursive String Reversal
AskAI Algorithms, Data Structures and Coding

This technical problem involves implementing a function that reverses a string using recursion. For example, given the input string "Hello", the function would return the output string "olleH".

121
Dec 06