tanong
click below
click below
tanong
Normal Size Small Size show me how
m1 m2 m3 DSA
lodiball
tanong | sagoat |
---|---|
data is organized in branches | Tree |
A more general branching structure, with less strict connection conditions than for a tree | Graph |
data type that separates the logical properties from the implementation details | Abstract Data Type (ADT): |
Support abstraction, encapsulation, and information hiding | Abstract Data Type (ADT) |
providing only essential information outside the world | Abstraction |
binding the data, and the functions that use them | Encapsulation |
Every Collection ADT should provide a way to: tatlo to | Add an item Remove an item Find, retrieve, or access an item |
values of the same types of data are stored | Homogenous |
values of different types are grouped and stored | Non-Homogenous |
Must be rich enough in structure to represent the relationship between data elements (T or F) | T |
Should be simple enough that one can effectively process the data when necessary (t f) | T |
Separating design details from usage | Abstraction: |
Separating the logical properties from the implementation details | Abstraction: |
The ___ in front of an ordinary variable produces the address of that variable. It produces a pointer that points to the variable. | & |
is simply called the address-of-operator | & operator |
When used as a unary operator, __ is the dereferencing operator or indirection operator | * |
Refers to object to which its operand points | Dereferencing Operator * |
operator in front of a pointer variable produces the variable to which it points. | * |
called the dereferencing operator. | * (example is *p) |
the memory address of a variable | Pointer |
Content is a memory of an address | Pointer Variable |
Declaring Pointer Variables: (paano) | dataType *identifier; Examples: int *p; char *ch |
creates a new dynamic variable of a specified type and returns a pointer that points to this new variable | new operator |
special area of memory that is reserved for dynamically allocated variables | heap (freestore) |
Any new dynamic variable created by a program consumes some of the memory in the freestore (true or false) | true lods |
If there was insufficient available memory to create the new variable, then new returned a special value named ___ | NULL |
eliminates a dynamic variable and returns the memory that the dynamic variable occupied to the freestore manager so that the memory can be reused. | Delete operator |
if a pointer variable pointing to the dynamic variable that was destroyed and becomes undefined, they are called dangling pointers. | Dangling pointers |
ou can assign a name definition and use the type name to declare variables using typedef keyword. | type definitions |
a series of connected nodes, where each node is a data structure | Linked List |
Can grow or shrink in size as the program runs | Linked List |
Can easily grow or shrink in size | Linked List |
Linked Lists Insertion and deletion of nodes is quicker with linked lists than with vectors True or Fols | True |
Each node in a linked list contains one or more members that represent data t or f | True |
In addition to the data, each node contains a pointer, which can point to another node. | True |
A linked list is called “linked” because each node in the series has a pointer that points to the next node in the list t or f | True |
TINATAMAD NA AKONG ILAGAY YUNG IBANG TERMS FROM MODULE 3 TIGNAN NIYO NALANG YUNG MISMONG FILE SALAMAT | galing mo merl (di ako si mat) |
What STL mean? | Standard Template Library |
STL lists can insert elements, or add elements to their front quicker than vectors can, because lists do not have to shift the other elements t or f | True |
this member function returns a reference to the last element in the list | back |
list.erase(iter); list.erase(firstIter, lastIter) The first example causes the list element pointed to by the iterator iter to be removed. The second example causes all of the list elements from firstIter to lastIter to be removed. | erase |
this member function returns true if the list is empty. If the list has elements, it returns false. | empty |
returns a bi-directional iterator to the end of the list | end |
returns a reference to the first element of the list | front |
this member function inserts an element into the list. The example shown above inserts an element with the value x, just before the element pointed to by iter. | insert |
inserts all the items in list2 into list1. list1 is expanded to accommodate the new elements plus any elements already stored in list1. merge expects both lists to be sorted. When list2 is inserted into list1, the elements are inserted into their corr | merge |
removes the last element of the list | pop_back |
removes the first element of the list | pop_front |
inserts an element with value x at the end of the list | push_back |
inserts an element with value x at the beginning of the list | push_front |
reverses the order in which the elements appear in the list. | reverse |
Returns the number of elements in the list | size() |
swaps the elements stored in two lists. For example, assuming list1 and list2 are lists, the statement shown above will exchange the values in the two | swap |
removes any element that has the same value as the element before it. | unique |
mobile legends | nanay mo mobile legends |