Back to marketplace

Topic 5 (Linked lists, Binary Trees)

No description yet. This curated deck is ready for daily study.

Total cards: 20•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (20)

#1
Front (Question)

3 types of linked lists

Back (Answer)

• Single linked • Double linked • Circular linked

#2
Front (Question)

What are linked lists composed of?

Back (Answer)

Header, pointer, node, tail

#3
Front (Question)

What does each node contain? (does not apply to doubly linked list)

Back (Answer)

• An information field (the data itself) • Pointer (Points to the memory address of the next node in the LinkedList)

#4
Front (Question)

How to draw single linked list

Back (Answer)

• Draw nodes in order, each node should have 2 sections: Data, and a black dot (will be used for pointers) • Draw the first pointer pointing to the first node from the left side, make sure it also has a circle and write “First” underneath it. • In the last node, there is no pointer, rather replace the dot section with the word “null” • Draw the other pointers going from one node to the next (left to right) and make sure to connect the base of the pointer to the dot of the node it is originating from.

#5
Front (Question)

Circular linked list what is it

Back (Answer)

It’s basically the same as a single linked list except the tail points back to first node

#6
Front (Question)

Doubly linked list

Back (Answer)

Each node contains 3 components. Previous, Information Field, Next You can move back and forth in the list Otherwise, it is the same as a single linked list

#7
Front (Question)

The head is synonymous to which Collections method?

Back (Answer)

.getNext() Accesses the first node

#8
Front (Question)

Traversing linked list how it works for each list

Back (Answer)

Singled linked list: You can only move forward and it ends at the last node Circular linked list: You can only move forward however the list repeats itself Doubly linked list: You can move forward and backward however the list can end

#9
Front (Question)

How to add a node into a linked list

Back (Answer)

Find the 2 nodes where you want to enter the new node between. Imagine a sandwich. The node on the left should now point to the new node’s memory address and the the new node points to the memory address of the node on the right.

#10
Front (Question)

Root node in a binary tree

Back (Answer)

The node at the top

#11
Front (Question)

Parent and child rules in a binary tree

Back (Answer)

Each parent can only have 2 children

#12
Front (Question)

How to build a binary tree with a list of numbers

Back (Answer)

First number in list becomes the root node, then if the next number is bigger than the root, it turns into a right child, if it’s less it it turns into a left child. Then, from here you know

#13
Front (Question)

Deleting nodes from a binary tree

Back (Answer)

Delete the node, then just make the connections between parent and child of the remaining nodes still make sense according to binary tree rules

#14
Front (Question)

On this whole condition checking thing in binary trees we always base it off the what?

Back (Answer)

Parent node, whether that be the root node or a subset of leaves

#15
Front (Question)

Trick for doing pre order traversal binary tree

Back (Answer)

Draw a line with a ball pointing to the left from each node. e.g. 🔴–7 Now, start at the top left node based on the line and traverse through the binary tree whilst sticking to the top left rule.

#16
Front (Question)

Trick for doing in order traversal binary tree

Back (Answer)

Draw a line with a ball pointing down from each node. e.g. 7 I 🔴 Now, start at the top left node based on the line and traverse through the binary tree whilst sticking to the top left rule.

#17
Front (Question)

Trick for doing post order traversal binary tree

Back (Answer)

Draw a line with a ball pointing to the right from each node e.g. 7–🔴 Follow the top left rule but do not skip any nodes (so you kinda have to go under and around the tree)

#18
Front (Question)

1 pro and 1 con of a binary tree

Back (Answer)

• Efficient searching and sorting (algorithm essentially halves the remaining trees every time) • Needs to be “balanced”

#19
Front (Question)

2 examples of where circular linked lists are used

Back (Answer)

• A media playlist that repeats endlessly • When multiple applications are running in a PC. A circular linked list is used to go through each application in use in a circular order and given an equal share in processing power

#20
Front (Question)

Difference between dynamic and static data structure

Back (Answer)

Static data structures are allocated at compile-time with a fixed size, while dynamic data structures are allocated at runtime and can change in size.