MongoDB: Advance concepts - Replication and ShardingKnoldus Inc.
The document discusses MongoDB replication and sharding. Replication allows for data redundancy across servers and increases availability. A replica set consists of primary and secondary nodes that replicate data from the primary. Sharding partitions data across multiple machines (shards) using a shard key and distributes data evenly. Choosing an appropriate shard key is important for uniform distribution of operations across shards.
Selection sort works by iteratively finding the minimum/maximum element from the unsorted portion of the list and placing it at the end/beginning of the sorted portion. It does this by scanning the unsorted portion to find the minimum/maximum element, swapping it with the element in the last position of the unsorted portion, and moving it to the sorted portion. This process is repeated until the entire list is sorted.
Mark Zuckerberg is the founder and CEO of Facebook, based in Palo Alto, California. The document discusses Facebook's business model, which includes brand advertising, self-service ads, and virtual goods revenue. It also covers Facebook's growth through word-of-mouth marketing and its social graph, and compares Facebook's features to its then-competitor MySpace.
The document discusses the "Step Wise" approach to planning software projects. It involves 10 main steps: 1) establish project scope and objectives, 2) establish project infrastructure, 3) analyze project characteristics, 4) identify products and activities, 5) estimate effort for each activity, 6) identify activity risks, 7) allocate resources, 8) review and publicize the plan, 9) execute the plan, and 10) create lower level plans. Each step is then explained in more detail with examples provided for clarification.
This document introduces software project management. It discusses how software projects are a type of project that faces particular challenges related to invisibility, complexity, conformity, and flexibility. The document outlines the typical activities in software project management, including planning, execution, and control. It emphasizes that setting clear, measurable objectives and maintaining management control over projects are essential practices in software project management.
28. การวัดประสิทธิภาพ
void insertion_sort(int data[], int num_elts)
{
int i, j;
for (i=0; i<num_elts; i++)
for (j=i; (j>0) && (data[j] < data[j-1]); j--)
swap(data, j, j-1);
} /* insertion_sort */
void swap(int data[], int a, int b)
{ int temp;
temp = data[a];
data[a] = data[b];
data[b] = temp;
} /* swap */
Big-O =
n2
29. การวัดประสิทธิภาพ
void selection_sort(int data[], int num_elts)
{
int i, j, lowindex;
for (i=0; i<num_elts; i++) /* Select i'th record */
{ lowindex = i; /* Remember its index */
for (j=num_elts-1; j>i; j--) /* Find the least value */
if (data[j] < data[lowindex])
lowindex = j; /* Put it in place */
if (i != lowindex) /* To reduce swap() operation */
swap(data, i, lowindex);
}
} /* selection_sort */
void swap(int data[], int a, int b)
{ int temp;
temp = data[a];
data[a] = data[b];
data[b] = temp;
} /* swap */
Big-O =
n2
30. การวัดประสิทธิภาพ
void bubble_sort(int data[], int num_elts)
{
int i, j;
for (i=0; i<num_elts; i++)
for (j=num_elts-1; j>i; j--)
if (data[j] < data[j-1])
swap(data, j, j-1);
} /* bubble_sort */
void swap(int data[], int a, int b)
{ int temp;
temp = data[a];
data[a] = data[b];
data[b] = temp;
} /* swap */
Big-O =
n2