Skip to main content
Filter by
Sorted by
Tagged with
5 votes
2 answers
128 views

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 ...
Hubert Kauker's user avatar
1 vote
1 answer
126 views

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 ...
anf's user avatar
  • 43
1 vote
1 answer
258 views

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 ...
Solal Peiffer-Smadja's user avatar
0 votes
1 answer
75 views

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 ...
FlarrowVerse's user avatar
-2 votes
1 answer
83 views

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
2 votes
1 answer
113 views

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 ...
Paul C's user avatar
  • 8,429
2 votes
1 answer
98 views

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
1 vote
1 answer
104 views

GOAL The 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 ...
selenio34's user avatar
  • 202
-2 votes
1 answer
39 views

I currently have a process in place, but need to reformulate it to be more efficient. I will describe the new process and I would like to know if the new process is optimal and follows proper coding ...
feonyte's user avatar
  • 199
1 vote
1 answer
269 views

Problem: A ball is thrown up after sometime it loses momentum and starts falling back A car moving in direction x and taking a U-turn & starts returning A planet moving prograde and becomes ...
AviD1511's user avatar
  • 149
-4 votes
1 answer
259 views

The answer for all three situations is supposedly 3, i dont understand why that is, can someone please explain what is going on and the reasoning behind it, why is the answer 3 for all situations ? I ...
Girlwhoisnewtocode's user avatar
0 votes
0 answers
76 views

The problem I marked in the picture is choosing the shortest path for the greedy and Dijkstra algorithms, now I'm confused because there are 2 identical paths, namely B to C and B to D. Which path ...
Mks Akbar's user avatar
1 vote
3 answers
228 views

I am trying to meet these requirements: Cards should be drawn in a pseudo-random order, Hearts and the Ace of Spades will be considered special cards with increased chances of being drawn. Each Heart ...
karrjm's user avatar
  • 19
0 votes
1 answer
1k views

Write a pseudocode on implementing a queue through an array named Q of size n with 1-based indexing( i.e the index of Q starts from 1 instead of the usual 0). The two functions below called Q.head and ...
Thomas Finley's user avatar
0 votes
0 answers
168 views

My assignment is to write Pseudocode for a program I was told to create. The Color Mixer program in Python. Here are two examples of how to write the Psuedocode out of the book I was told to read. ...
Brandon Parker's user avatar
0 votes
1 answer
586 views

I am trying to create a multiplication table from 1 to 10, but print each line one at a time. I need to know how to do this in flowgorithm. I have the chart correct to print the multiplication table ...
Rashad Vaughn's user avatar
0 votes
1 answer
53 views

I have a graph with two lines that measure the volume flow of some goods. Every 5 minutes I receive new points for two lines. When I visually see that two lines are next to each other and go through ...
Madi Kalygin's user avatar
0 votes
1 answer
51 views

I am working with pseudocode taken from Exploration Tools (section "Arm A64 Instruction Set Architecture", button "Download XML"). bits(16) BFSub(bits(16) op1, bits(16) op2, ...
pmor's user avatar
  • 6,757
-2 votes
1 answer
78 views

I partially understand what the question is asking but why are all answer choices not right?
Pranavi Kedari's user avatar
0 votes
1 answer
517 views

I've been creating a program that determines the number of paint cans required to paint a room. My professor had us write the pseudocode for the program, and now wants us to modify the code by ...
Heidihale58's user avatar
0 votes
1 answer
75 views

I am trying to code the IBM Modele using its pseudo-code And I believe my code should work but for different iteration numbers the output is printing the same and I have no idea why this is happening....
Emin-35's user avatar
  • 73
0 votes
1 answer
581 views

I am working on writing the pseudocode for a calorie counting program that calculates the total weekly calories for breakfast. the program should allow the user to enter the number of calories ...
Heidihale58's user avatar
-1 votes
1 answer
701 views

Below is the pseudo-code. In my opinion, it is the pseudo-code is trying to find the peak elements along with their index in a list of tuples. The output on my end is : [(1, 4), (4, -9), (7, 12), (9, -...
Aman Raheja's user avatar
1 vote
1 answer
99 views

During an interview I was given the following problem: From the following puzzle, what would the output of puzzle(power(2022, 100)) be? function puzzle(N) { A, B, C, D = 1, 1, 1, 1 .repeat N ...
Lautaro Graciani's user avatar
-1 votes
1 answer
251 views

I am looking at the truth table for following pseudocode. IF year = 11 AND (grade < target OR target >7) THEN SET revision_class TO true END IF I want to know whether the below truth table ...
Norvin's user avatar
  • 21

1
2 3 4 5
39