List And Pointer Flashcards

(7 cards)

0
Q

What are the disadvantages of linear list/array

A

Memory locations may be wasted.
Insertion of an element within an ordered list required moving elements.
Deletion of an element within a list requires moving elements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

What are the advantage of an array/linear list

A

It’s easy to program

If elements are stored in key order, a binary search is possible

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are pointers?

A

A pointer is a variable that contains an address. A pointer points to the memory location with that address.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What’s an heap?

A

The memory locations available to application program for dynamic allocation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What’s a “dynamic allocation”?

A

A dynamic allocation: memory space is only allocated when required at run time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are advantages of the heap?

A

More efficient use of memory when dealing with data of unknown and changing size

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What’s a dynamic structure

A

The amount of memory taken up can vary at run time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly