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.

An easy way of understanding pseudocode is by comparing it to the actual programming language.

For example, you would like to write a code that checks if the student's grade is above the permissible threshold, and if it is then you would like to indicate that the student passed.

This is how it is achieved in Python:

if studentsGrade >= 70:
    print("Student passed")
else
    print("Student failed")

Pseudocode to describe the abovementioned code will be as follows:

if a student's grade is greater than or equal to 70
    Print "Student passed"
else
    Print "Student failed"
1942 questions
0
votes
1 answer

pseudocode input age, calculate max and average for java

Write a pseudo code algorithm which will input a series of people's ages (as integers between 1 and 120 inclusive) and calculate the maximum and average age. The average age should be calculated as a real number. Your algorithm should continue to…
cheong kim
  • 21
  • 1
  • 7
0
votes
1 answer

Finding one coin of N in q steps

Subject: Finding One Coin of 13 in 3 Steps There is a pile of thirteen coins, all of equal size. Twelve are of equal weight. One is of a different weight. In three weighings(using scales) find the unequal coin and determine if it is heavier or…
Lazar Lazarov
  • 2,412
  • 4
  • 26
  • 35
0
votes
2 answers

Binary tree, deleting item and reconnecting node

I'm learning data structures and found out that for binary search trees, there are two ways to reconnect node when you delete item. Are those two ways (below) correct? Link to the image to see it non-resized
gameboy
  • 1,505
  • 3
  • 15
  • 16
0
votes
1 answer

Make math operations on a grouped table

My problem is not in a real programming Language. I have an exercise in ABAP Language but is not very important the language. Anyway, I have a table: I need to make the total cost of the position(after the select obviously). Then, the table will be…
0
votes
1 answer

How to update posterior distribution in Gibbs Sampling?

All, I'd like to estimate the parameter P ,Q whose prior distribution is P ~ N (A,B) Q ~ N (C,D) Then, I find the full conditional distribution of P,Q are P|Q ~ N (A*,B*) Q|P ~ N (C*,D*) where A* is a function of A , B , Q [A*=f(A,B,Q)] B* is a…
Ying
  • 1,894
  • 1
  • 14
  • 20
0
votes
1 answer

Dijkstra's Algorithm length

from this website's pseudocode: Given a graph, G, with edges E of the form (v1, v2) and vertices V, and a source vertex, s dist : array of distances from the source to each vertex prev : array of pointers to preceding vertices i : loop…
kmlkz
  • 63
  • 5
0
votes
1 answer

GROUP_CONCAT for grouping multiple rows for a user

How do I create a query for grouping the users who have sent or received message from user 1. SQL: http://sqlfiddle.com/#!9/7d6a9 for usr_msg http://sqlfiddle.com/#!9/3ac0f for token_msg. I have 2 tables: token_msgs and user_msgs: I want to show…
Somename
  • 3,376
  • 16
  • 42
  • 84
0
votes
1 answer

Web Storage types

After arguing with a few colleages We didnt get an agreement... My point is the next one: Why Should I use Local Storage? I don´t like (as user) that someone stores information in my computer. As longer as I saw, whatever information which I need…
0
votes
2 answers

Mapping User Input to Text File List

I'm trying to make a function that, given input from the User, can map input to a list of strings in a text file, and return some integer corresponding to the string in the file. Essentially, I check if what the user input is in the file and return…
B. Bush
  • 37
  • 5
0
votes
0 answers

How does Windows's hiding drive mechanism work

There is a interesting way to hide drives in Windows by changing a value in registry. Every drive label corresponds to a value, so that they form a unique value at the end. But how does Windows know what does the value represent? The mechanism works…
cssjs50
  • 51
  • 5
0
votes
1 answer

Pseudocode for adding 2 until number is 100

I have a pseudocode assignment for a class. I have to design a program to output every even number starting with 2 and going to 100. I need someone to tell me if this is correct. If it isn't could someone point me in the right direction? start …
0
votes
1 answer

Loop over dynamically changing list

What would be a good approach/algorithm to allow me to loop over a dynamically changing list. This list can contain duplicates I only need the next element after the current element. i.e if I'm currently on a[n] in the next iteration, I want a[n]…
Krimson
  • 7,386
  • 11
  • 60
  • 97
0
votes
1 answer

I need to calculate the range of the max overlapping occurances not the max number of them

Assume that I have a dataset with numbers (start, stop): 4556745 , 4556749 4556749 , 5078554 … and so on I want to make a chunk of code in order to print the range (start, stop) in which the max overlapping is occurred. Till now I have managed…
Gizmapps
  • 59
  • 1
  • 10
0
votes
2 answers

Implement Array Random Shuffle

Prelude I am writing a grid-based random-map generator. Currently, I want to populate a 2D array with a variety of tiles. Problem In the parenthesis is a more concrete example. Here is what you are given: 2D array and its dimensions. (i.e. 3x4…
0
votes
1 answer

shortest path between all vertex using bfs

I'm learning about graph theory and I need help. I need algorithm for shortest path between all vertex in graph using bfs. I know how bfs works but I don't know "remake" that algorithm to find shortest path between all vertex in graph.