GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — BinaryTree method find() confusing return value · Issue #104 · TheAlgorithms/Java

BinaryTree method find() confusing return value #104

New issue
Copy link
New issue
Copy link
Closed
Closed
BinaryTree method find() confusing return value#104
Copy link

Description

@mpokryva
mpokryva
opened on Sep 28, 2017
Issue body actions

The find(int key) method in the BinaryTree class returns the node with the value int, if it's found, and root if there is no such node. This is confusing behavior, first of all, as one would expect it to return null, and is also problematic, since the root itself can match the query.

I suggest simply changing this function to return null on an unsuccessful query.

Reacted by rei2hu

Activity

  1. mpokryva
    added 2 commits that reference this issue on Sep 29, 2017

    Changed find(int key) method to return null when node is not found, and

    5e345eb

    Changed find(int key) method to return null when node is not found, a…

    e538158
  2. christianbender
    closed this as completedon Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.