0% found this document useful (0 votes)
10 views

List - Group 4

Uploaded by

Kuya Kim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

List - Group 4

Uploaded by

Kuya Kim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

LIST

DATA
STRUCTURE
Group 4
List
• Is also known as a sequence.

• An abstract data type in which the elements are


stored in an ordered manner for easier and
efficient retrieval of the elements.

• Allows repetition as each entry of that repeating


data is considered as a distinct item or entry.
List
• Can store different data items in its object using
union or struct.

• Can be called Dynamic size arrays, which means


their size increased as we go on adding data in
them and we need not to pre-define a static size
for the list.
In C, the terms "list" and "array" can be
confusing because C doesn't have a
built-in "list" type like some higher-
level languages (such as Python).
Instead, C uses arrays, and linked lists
are implemented manually by
programmers.
In Python, you can store different data types in a
list. Python lists are dynamic and can hold
elements of different types, including integers,
floats, strings, objects, or even other lists. This is
possible because Python is a dynamically typed
language, meaning the data type of each
element is checked at runtime, not during
compilation.
Difference
between List and
Array
List occupies much more memory as every
node defined the List has its own memory set
whereas Arrays are memory-efficient data
structure.

A list is derived from Collection, which contains


a more generic data type, whereas Array is
fixed and store a more strong data type.
Various Operations
on the List Data Structure:
Add or Insert Replace or reassign
Operation:
• In the Add or Insert operation, a Operation:
• In the Replace or reassign operation, the
new item (of any data type) is already existing value in the List object is
added in the List Data Structure changed or modified. In other words, a
or Sequence object. new value is added at that particular
index of the already existing value.
Delete or remove Find or Lookup or Search
Operation:
• In the Delete or remove Operation:
operation, the already present • In the Find or Lookup operation, the
element is deleted or removed element stored in that List Data
from the Dictionary or Structure or Sequence object is
associative array object. fetched.
Quiz
Quiz
1. What is a List in the context of data structures?
A) A data type that stores elements in a random order.
B) A data type that stores elements in an unordered way.
C) A data type that stores elements in an ordered manner and allows
repetition.
D) A data type that cannot store repeated elements.
2. Which of the following statements is true about Lists in Python?
A) Lists in Python must have elements of the same data type.
B) Lists in Python are dynamic and can hold elements of different data
types.
C) Lists in Python are fixed in size.
D) Lists in Python cannot store other lists as elements.
3. What is the key difference between a List and an Array?
A) Lists are memory-efficient, but Arrays are not.
B) Lists store elements of a fixed data type, but Arrays can store generic
types.
C) Lists occupy more memory because every node has its own memory set,
while arrays are more memory-efficient.
D) Lists can only store integers, while Arrays can store any data type.

4. In the context of Lists, what does the ‘Add’ or ‘Insert’ operation do?
A) It changes the value of an already existing element.
B) It removes an element from the list.
C) It adds a new item to the list, regardless of the data type.
D) It finds an element in the list.
5. Which operation modifies the existing value in a
List?
A) Add
B) Replace or Reassign
C) Delete
D) Search
6. What happens in the ‘Delete’ operation of a List?
A) A new element is added to the list.
B) An existing element is modified.
C) An element is removed from the list.
D) A search is performed for a specific element.

7. In C, how is a List typically implemented?


A) Lists are a built-in data type in C.
B) Lists are implemented using arrays or linked lists manually by the programmer.
C) Lists in C are the same as arrays.
D) Lists in C are implemented using dynamic memory allocation only.
8. What does the ‘Find’ or ‘Search’ operation in a List do?
A) It adds a new item to the list.
B) It modifies an existing item in the list.
C) It removes an item from the list.
D) It retrieves an element stored in the list.

9. Which data structure allows the addition of elements without needing to specify a
fixed size at initialization?
A) Array C) Stack
B) List D) Queue

10. Which of the following operations cannot be directly performed on an array


in C?
A) Accessing elements
B) Inserting elements at a specific position
C) Modifying elements
D) Iterating over elements
Group 4:

Czarinah Mae Bernados


Rainier Bejoc
Ikym Jay Cortez
Almari Trimidal

You might also like