Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
1 から 10 までの数字の二分探索図を描くにはどうすればよいですか? 2 つのサブツリーに分割されますか、それとも親ノードの右側にノードがある 1 本の直線になりますか? 図は、親ノードとして 1 から開始します。
真ん中の値はルートである必要があります。これは、ツリーの最低の高さを取得するためです。次に、リーフ ノードに到達するまで、各ノードに 2 つのポインターを書き込みます。
1,2,3,4,5,6,7,8,9,10
5 3 8 2 4 7 9 1 6 10