basic structs Flashcards

1
Q

what is data structures

A

is a systematic way of organizing and accessing data

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

how do you declare an array

A

type[] arrayname = new type[size];

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is inside a singly linked list

A
  • elements

- next

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

what is inside a doubly linked list

A

-elements
-next
-prev
can be added and deleted nodes from head or tail

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