1/31
Flashcards for review of data structures, stacks, queues, and data transmission concepts.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is a static data structure?
A static data structure has a fixed size declared at compile time. An example is a static array.
What is a dynamic data structure?
A dynamic data structure can change size during program execution. An example is a linked list.
What are two advantages of static arrays?
Easier to program and has faster access to individual data items.
What are two disadvantages of static arrays?
Inflexible size and inefficient memory use if not fully utilized.
What is a pointer in data structures?
A pointer stores a memory address, allowing access to data at that location in RAM.
What two components make up a linked list node?
A data item and a pointer to the RAM address of the next node.
What is the purpose of a NULL pointer in a linked list?
A NULL pointer indicates the end of the linked list.
How do you add a new data item to the end of a linked list?
Update the pointer of the last existing node to point to the address of the new item, and set the new item's pointer to NULL.
How do you delete an item from a linked list?
Update the pointer of the node before the item to be deleted to point to the node after the item to be deleted. The memory of the deleted node can then be freed.
What are two advantages of linked lists?
Dynamic size (expands and contracts as needed) and efficient memory use (only occupies memory for actual data items).
What are two disadvantages of linked lists?
Slower access to individual data items (must traverse from the beginning) and more complex to program.
What is a stack data structure?
A stack is a LAST IN, FIRST OUT (LIFO) data structure.
What are the two primary operations performed on a stack?
PUSH (to add an item to the top) and POP (to remove an item from the top).
Provide an example of where stacks are used in computing.
Undo/redo functionalities, or for managing function calls and interrupts in a CPU.
How is a stack used in CPU interrupt handling?
The current instruction and the contents of CPU registers are pushed onto a stack. After the interrupt, these items are popped off the stack in LIFO order.
What is a queue data structure?
A queue is a FIRST IN, FIRST OUT (FIFO) data structure.
What are the two primary operations performed on a queue?
PUSH (to add an item to the rear) and POP (to remove an item from the front).
Provide an example of where queues are used in computing.
Printer queue.
How does a printer queue demonstrate the FIFO principle?
Documents are processed in the order they were received (first in, first out).
Describe simplex data transmission.
Data is sent in only one direction.
Describe half-duplex data transmission.
Data is sent in both directions, but only one direction at a time.
Describe full-duplex data transmission.
Data is sent in both directions simultaneously.
What is point-to-point transmission?
A direct connection between two devices.
What is multi-drop transmission?
One sending device to multiple recipient devices.
What are the characteristics of synchronous data transmission?
Data is a continuous stream synchronized by a shared clock signal.
What is a disadvantage of synchronous transmission?
The two devices can fall out of sync.
What are the characteristics of asynchronous data transmission?
Data is sent in packets, with start and stop bits to identify the beginning and end of each packet.
What is a disadvantage of asynchronous transmission?
It is generally slower than synchronous transmission.
Describe parallel data transmission.
Sends multiple bits of data simultaneously over an equal number of wires or channels.
What are two disadvantages of parallel transmission?
More expensive cables and increased signal skewing.
Describe serial data transmission.
Sends bits of data one at a time over a single wire or channel. It is bi-directional and can be asynchronous or synchronous.
What are two advantages of serial transmission?
Can be used over longer distances and reduced cabling cost.