Movatterモバイル変換


[0]ホーム

URL:


Sorry, we no longer support your browser
Please upgrade toMicrosoft Edge,Google Chrome, orFirefox. Learn more about ourbrowser support.
Skip to main content
Stack Overflow
  1. About
  2. For Teams
Loading…
How are we doing? Please help us improve Stack Overflow.Take our short survey
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives
1,943 questions
Filter by
Sorted by
Tagged with
4votes
2answers
111views

Translate permutation algorithm by Sedgewick from Pseudocode into JavaScript

In his classical paper Permutation Generation Methods, Computing Surveys 1977, Robert Sedgewick presents his "Algorithm 1" on page 140 like this:procedure permutations(N); begin ...
-1votes
1answer
43views

How could I turn a variable into a number of seconds equal to that variable's number of minutes

I want to turn a variable (let's say with a current value of 20) into a value that is <variable> minutes (in to), so a variable of 20 turns into 1200 (the number of seconds in 20 minutes)How ...
Cobalt's user avatar
1vote
1answer
122views

Is it possible to find the average of a group of numbers and return the index of the number furthest from the average with one loop?

Specifically:Write a function (in python, java or pseudocode) average(nums) that prints the mean of the numbers in list nums, and returns a tuple:The tuple's first element is the index of the ...
2votes
1answer
103views

Can the A* search algorithm be implemented without a closed list?

The A* search algorithm is usually implemented using an open and a closed list (or other data structures). Recently I read in Wikpedia a pseudocode that makes use only of an open list.Is the closed ...
Sam's user avatar
  • 488
1vote
1answer
225views

Branch and bound problem, how to enumerate all of the possibilities?

Here is a problem that was in a past exam for Advanced algorithms in my studies,it's on 5 points over 3 hours so should take approximately 1H but I am struggling to find the solution for the first ...
1vote
2answers
67views

Producer-consumer queue in multithreading, shutdown mechanism

I wrote the following pice of pseudocode. It is about the classic producer-consumer queue in multithreading, but I am trying to add a graceful shutdown mechanism. I want consumeItem to keep working ...
0votes
1answer
62views

Convert nested recursive algorithm (Ackermann's function) to iterative algorithm

I came across a practice problem:I already wrote out the pseudocode for this, really easily too, just made the calls to the function as mention in the problem statement. But I was really struggling ...
-1votes
1answer
81views

What is the worst-case runtime of this algorithm (in big-oh notation)? [closed]

The input is an N by N matrix of numbers. Each individual row is increasing from left to right. Each individual column is increasing from top to bottom. The example of a matrix is given below with N = ...
-2votes
1answer
70views

Average of non-negative integers using integer division [closed]

Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input, and outputs the average (using integer division) and max. A ...
Grace Fitz's user avatar
2votes
2answers
158views

POSIX-Extended RE for substrings that start with a prefix, end with a suffix and whose inner part does not contain any element of a given set [closed]

I have an input string S and three parameters: a prefix string (denoted by A), a suffix string (denoted by B) and a set N of strings.Given these three parameters, is it possible to generate a single ...
lyrically wicked's user avatar
2votes
1answer
109views

Does this algorithm for converting a Binary Search Tree into a sorted linked list on Wikipedia have a bug in it?

I wanted to get a sanity check here. I believe the algorithm listed on the wikipedia page for the Day–Stout–Warren algorithm for balancing BSTs has a problem.This pseudocode purports to turn a BST ...
-1votes
1answer
86views

Curious if this problem can be solved more elegantly (maybe using recursion?) [closed]

I'm a graduate student in biology that encountered a problem that I really struggled solving in my project. I solved it using an iterative approach (will describe more below) but was curious if there ...
Betelgeuse's user avatar
2votes
1answer
97views

Determine next building upgrade in Monopoly

Each street in Monopoly is comprised of 2 or 3 different properties.When a user upgrades a street, it will build 1 of 3 buildings on the appropriate property.House - least valuable, will build this ...
Will's user avatar
  • 408
1vote
0answers
103views

Maximum Sum of Vertices in DAG Excluding Directly Connected Vertices

How can I calculate the maximum possible sum of vertices in a weighted DAG excluding vertices directly connected by an edge? This is a vertex selection problem where each vertex has a weight.In this ...
1vote
1answer
101views

Hash table average complexity of functions

GOALThe goal is to use a chained hash table, with a hashing function h that satisfies the Simple Uniform Hashing Assumption, to store some numbers (the same number, if inserted multiple times, is ...

153050per page
1
2345
130

Related Tags

 × 775
 × 164
 × 163
 × 115
 × 84
 × 82
 × 78
 × 75
 × 73
 × 72
 × 63
 × 52
 × 50
 × 46
 × 43
 × 41
 × 40
 × 39
 × 31
 × 31
 × 31
 × 30
 × 27
 × 27
 × 23
more related tags

Hot Network Questions

more hot questions
Newest pseudocode questions feed

[8]ページ先頭

©2009-2025 Movatter.jp