Learning Pseudocode: A Crash Course for Beginners

  • Context: Comp Sci 
  • Thread starter Thread starter shivajikobardan
  • Start date Start date
  • Tags Tags
    Beginners Course Crash
Click For Summary
SUMMARY

The discussion centers on learning pseudocode, specifically through the implementation of the minimax algorithm. A user seeks guidance on understanding and applying pseudocode, having a basic knowledge of Python and object-oriented programming but lacking notes on data structures and algorithms (DSA). The conversation highlights the importance of resources like Wikipedia for explanations and emphasizes the need for clarity in pseudocode versus actual programming languages.

PREREQUISITES
  • Basic understanding of Python programming
  • Familiarity with data structures and algorithms (DSA)
  • Knowledge of object-oriented programming (OOP)
  • Ability to read and interpret algorithmic pseudocode
NEXT STEPS
  • Study the minimax algorithm in detail
  • Learn about the differences between pseudocode and actual programming languages
  • Explore resources on data structures and algorithms, focusing on tree traversal techniques
  • Practice writing pseudocode for various algorithms to enhance understanding
USEFUL FOR

Beginner programmers, computer science students, and anyone looking to strengthen their understanding of algorithmic thinking and pseudocode implementation.

shivajikobardan
Messages
637
Reaction score
54
Homework Statement
minimax algorithm artificial intelligence
Relevant Equations
algorithm given below
I found pseudocode for this problem below-:

Code:
def minimax(current node):
    if is_leaf(current_node):
        return static_evaluation(current_node)
    if is_min_node(current_node):
        return min(minimax(children_of(current_node)))
    if is_max_node(current_node):
        return max(minimax(children_of(current_node)))
How do I learn to do it? I have no idea. Learning these stuffs would be immensely useful. I have ok programming experience. Learnt about dsa and stuffs but I don't have any notes from that time and don't remember much stuffs. Know basic python. Know oop but like dsa forgot and don't have the notes...What to do?
 
Physics news on Phys.org
shivajikobardan said:
How do I learn to do it?

The explanation on Wikipedia is reasonable, with similar pseduocode (although that toggles a flag for alternating player whereas the code above has that information in the node).
 
pbuk said:
The explanation on Wikipedia is reasonable, with similar pseduocode (although that toggles a flag for alternating player whereas the code above has that information in the node).
any idea how to implement it?
 
shivajikobardan said:
any idea how to implement it?
Follow the explanation accompanying the code. I suggest you use the Wikipedia page I linked, the code you posted (which appears to be Python not pseudocode) is rubbish: the first line says that the function minimax has a single node as its only argument but on lines 5 and 6 it is called with what must be a list of nodes.
 

Similar threads

  • · Replies 15 ·
Replies
15
Views
6K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 9 ·
Replies
9
Views
11K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K