Questions tagged [pseudocode]
Pseudocode is a compact and informal high-level description of a computer programming algorithm. It represents the code and may look similar to the code or code constructs, but it isn't actual code. It is a representation of the code or code construct. Use this tag for questions which are about pseudocode. Do not use this tag for questions which include pseudocode incidentally.
pseudocode
1,941
questions
2
votes
1
answer
70
views
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 ...
1
vote
0
answers
83
views
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 ...
1
vote
1
answer
86
views
Hash table average complexity of functions
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 ...
0
votes
1
answer
52
views
I am trying to convert this pseudo code into hack language saved as an .asm file
I have been stuck trying to figure out how to translate pseudo code into hack language formatted as .asm, that will run successfully using the CPUEmulator.sh in the Nand2Tetris, with attached .tst &...
-2
votes
1
answer
27
views
Optimizing R script for querying Teradata data dynamically and handling weekends [closed]
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 ...
0
votes
0
answers
39
views
Issues in Data Anonymisation for a Big Data coursework/Assignment
I am trying to do data anonymization. The patient's data is getting anonymised. However, there seems to be still some issues in picking up few data. Can someone help me in finding the issue in my code?...
0
votes
0
answers
11
views
How to analysis CNN model?
Hellow all,
What is Interpretability analysis of CNN model?
What is the computational complexity of the CNN model?
AlexNet model
model = tf.keras.Sequential([
Conv2D(96, kernel_size=(11,11), ...
0
votes
0
answers
26
views
Writing a for loop condition in pseudocode
How do I write a program to accept a number from the user 100 times using a for loop, with just the for loop syntax only? No programming language is required, just the syntax in pseudocode form.
I ...
1
vote
1
answer
38
views
Find the coordinates of the minimum bounding rectangle enclosing two rectangles
Given the coordinates of the top left corners of two rectangles (x1, y1), (x2, y2), their respective widths and heights (w1, h1), (w2, h2) (They may or may not overlap). How do I find the coordinates ...
1
vote
1
answer
109
views
How to find when the object changed its direction of motion
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 ...
-1
votes
2
answers
116
views
How do I convert if else to && || in if the result is the same
how do i replace if else to && || if the output for each condition is the same in these cases
there are multiple different conditions to be met before reaching the outputs and each case has ...
-4
votes
1
answer
97
views
What will be the output of the pseudocode below and why?
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 ...
-1
votes
1
answer
98
views
Merge step of the Merge sort algorithm [closed]
I have a question and I hope someone could help me. I really don't understand the pseudo code of the merge step of the merge sort algorithm. I understand how it works but not the code. Would be ...
0
votes
0
answers
27
views
How does this pseudocode with polynomials print 30? I realize this is a stupid question
n = 0
for (i = 10, i >= 0, i = i - 2)
n = n + i
print(n)
I ran through this, and I got 2 instead of 30, which is correct, of course. Here's the part where I ask a stupid question: Why is it 30?...
0
votes
0
answers
51
views
i have greedy and dijkstra algorithms with the same distance. My question is which distance to choose, B to C or B to D
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 ...