Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
4 votes
0 answers
57 views

SHA1 Algorithm Implementation in Zig

I have implemented the SHA1 algorithm in Zig, as a learning exercise, to teach myself both Zig and the actual algorithm behind SHA1. Now the second part I think I understood well enough. The ...
Rohit Tanwar's user avatar
9 votes
4 answers
2k views

"Weird Algorithm" (Collatz) from CSES Problem Set

I had to solve the following problem: Consider an algorithm that takes as input a positive integer n. If n is even, the algorithm divides it by two, and if n is odd, the algorithm multiplies it by ...
user23259461's user avatar
9 votes
3 answers
2k views

Is set of integers closed under the operation of subtraction?

I was working on a problem, but my solution did not pass the time limit test. Problem Let's say a set of integers is closed under the operation of subtraction if for two distinct elements of this set ...
user27571279's user avatar
4 votes
2 answers
162 views

Basic Linked List Implementation in JavaScript

Clarification of Intent Recursion here is used on purpose for practice - note that iteration is preferred in this case (I'll be more clear about where my intentions are!) Factory function was also ...
bdng's user avatar
  • 41
5 votes
3 answers
1k views

Coding exercise to represent an integer as words using python

Context: Convert a non-negative integer num to its English words representation. Example 1: Input: num = 123 Output: "One Hundred Twenty Three" Example 2: Input: num = 12345 Output: "...
Silah's user avatar
  • 103
7 votes
3 answers
208 views

Euler - Largest Palindrome Product in Java

Having been going over the documentation, learning more of the subtleties of Java. I am now going over some basic Project-Euler solution code I wrote a little while back. Hoping I can pick up some ...
tijko's user avatar
  • 780
1 vote
0 answers
112 views

Rust implementation of a BTree

I'm studying rust, and I decided to implement a BTree as a way of learning the language. Can anyone give me suggestions on the code? As the language has no inheritance, and we must replace it with ...
Lucas Paixão's user avatar
2 votes
1 answer
37 views

Simplify matching values while comparing two sorted sets

This is in Star Basic but most likely quite a few languages would have similar structure. I am comparing rows in two sorted sheets. I have a comparison function which returns -1 / 0 / 1 similarly to <...
chx's user avatar
  • 376
8 votes
3 answers
2k views

Sieve of Eratosthenes in C++ with wheel factorization

I have written a completely working C++ program for the first time, and I have managed to compile it. I have decided to learn C++ and I have written a C++ program to familiarize myself with C++, this ...
Ξένη Γήινος's user avatar
2 votes
1 answer
671 views

Find all permutations of string using recursion

Background: I am somewhat new to programming and only two weeks into learning Python. Currently trying to improve my understanding of recursion, which has been a tough concept for me to implement. ...
b-mitch's user avatar
  • 21
3 votes
1 answer
163 views

String Permutation Implemention

The objective is simple: List all possible permutations for a given a String. I looked at some implementations from popular sources. I decided to build this to the flow: The Code for Review ...
Amal Krishnan's user avatar
0 votes
1 answer
175 views

Bookstore program using standard algorithms

This is the exercise, from C++ Primer 5th edition: 10.32: Rewrite the bookstore problem from § 1.6 (p. 24) using a vector to hold the transactions and various algorithms to do the processing. Use <...
matan izhak's user avatar
0 votes
1 answer
188 views

Getting three numbers input interactively and process them

I'm new to Python and programming in general. Let's imagine I have a simple task: Given 3 numbers from user input, I need to count negative ones and print the result. Considering what I know about ...
QLEDHDTV's user avatar
0 votes
1 answer
416 views

subsets in array. Algorithm (No Linq)

Task: A subset is a continuous segment of an array. Two integer arrays are given with elements from 1 to 100: of N and n (N > n). For every subset of the first array of n length find out the next ...
Sheeba334's user avatar
1 vote
2 answers
116 views

Object-Oriented Blackjack V2

[Edited] formatting and Flake8 linter corrections Four days ago I posted my first object oriented programming project. Everything I have learned to date is self-taught and posting project to receive ...
Infinite Grasp's user avatar

15 30 50 per page
1
2 3 4 5
21