Computer Science, asked by pg5980625, 9 months ago

difference between binary tree structure and single linked list.​

Answers

Answered by sumit1234570
0

Answer:

A binary tree is a special case in which each node has only two children. Thus, in a linked list, each node has a previous node and a next node, and in a binary tree, a node has a left child, right child, and parent. ... Linked List is straight Linear data with adjacent nodes connected with each other e.g. A->B->C.

Explanation:

please follow me

Answered by Anonymous
0

Linked List :

Node(1) -> Node(2) -> Node(3) -> Node(4) -> Node(5) -> Node(6) -> Node(7)

In linked list, the items are linked together through a single next pointer.

Next Node’s Key Can be larger or samller then previous Node.

Not Sorted

Time Complexity of Search :O(n) Insert : O(1) Delete : O(1) {if you have use optimized method }

Binary Search Tree:

          [4]

         /   \

      [2]     [6]

     /  \    /   \

   [1]  [3] [5]   [7]

In a binary tree, each node can have 0, 1 or 2 sub nodes.

The key of the left node is lesser than the key of the node and the key of the right node is more than the node

Sorted

Time Complexity of Search : O(log(n)) Insert : O(log(n)) Delete : O(log(n))

Similar questions