basic structs Flashcards
1
Q
what is data structures
A
is a systematic way of organizing and accessing data
2
Q
how do you declare an array
A
type[] arrayname = new type[size];
3
Q
diffrences between linked list and arrays
A
arrays
- elements of an array can be easily access by indices
- the capacity of the array is fixed when created
- intersion and deletion can be time consuming if many elements are to be shifted
linked lists
- size can be easily changed
- elements can be added and deleted easily
- no quick access to elements
4
Q
what is inside a singly linked list
A
- elements
- next
5
Q
what is inside a doubly linked list
A
-elements
-next
-prev
can be added and deleted nodes from head or tail