Получи случайную криптовалюту за регистрацию!

C# 1001 notes

Логотип телеграм канала @csharp_1001_notes — C# 1001 notes C
Логотип телеграм канала @csharp_1001_notes — C# 1001 notes
Адрес канала: @csharp_1001_notes
Категории: Технологии
Язык: Русский
Количество подписчиков: 2.63K
Описание канала:

Регулярные короткие заметки по C# и .NET.
Просто о сложном для каждого.
admin - @notxxx1

Рейтинги и Отзывы

3.50

2 отзыва

Оценить канал csharp_1001_notes и оставить отзыв — могут только зарегестрированные пользователи. Все отзывы проходят модерацию.

5 звезд

1

4 звезд

0

3 звезд

0

2 звезд

1

1 звезд

0


Последние сообщения 13

2021-10-26 18:20:00
What will be the output of the following code snippet?
Anonymous Quiz
3%
1 2 3 4 5
15%
11 12 13 14 15
82%
11 2 13 4 15
0%
1 3 5 7 9
130 voters402 views15:20
Открыть/Комментировать
2021-10-26 18:20:00
397 views15:20
Открыть/Комментировать
2021-10-25 19:29:00
What is an Abstract Class?

The abstract modifier indicates that the thing being modified has a missing or incomplete implementation. The abstract modifier can be used with classes, methods, properties, indexers, and events.

An Abstract class is a class which is denoted by abstract keyword and can be used only as a Base class.

Abstract classes have the following features:

An abstract class cannot be instantiated.

An abstract class may contain abstract methods and accessors.

It is not possible to modify an abstract class with the sealed modifier because the two modifiers have opposite meanings. The sealed modifier prevents a class from being inherited and the abstract modifier requires a class to be inherited.

A non-abstract class derived from an abstract class must include actual implementations of all inherited abstract methods and accessors.

#post
442 views16:29
Открыть/Комментировать
2021-10-21 21:22:00
Here is a solution for the #challenge above

At first blush, it seems tricky but, in my opinion, this solution is really graceful
602 views18:22
Открыть/Комментировать
2021-10-21 18:22:00 #challenge

Largest Gap | #easy

Given an array of integers, return the largest gap between elements of the sorted version of that array.

Here's an illustrative example. Consider the array:

9, 4, 26, 26, 0, 0, 5, 20, 6, 25, 5

... which, after sorting, becomes the array:

0, 0, 4, 5, 5, 6, 9, 20, 25, 26, 26

... so that we now see that the largest gap in the array is the gap of 11 between 9 and 20.

Examples:

LargestGap(new int[] { 9, 4, 26, 26, 0, 0, 5, 20, 6, 25, 5 }) ➞ 11
// After sorting get { 0, 0, 4, 5, 5, 6, 9, 20, 25, 26, 26 }
// Largest gap of 11 between 9 and 20

LargestGap(new int[] { 14, 13, 7, 1, 4, 12, 3, 7, 7, 12, 11, 5, 7 }) ➞ 4
// After sorting get { 1, 3, 4, 5, 7, 7, 7, 7, 11, 12, 12, 13, 14 }
// Largest gap of 4 between 7 and 11

Leave your solutions in the comments. The solution will be posted below in a couple of hours

#interview
593 views15:22
Открыть/Комментировать
2021-10-20 18:21:00
All of these interfaces inherit from IEnumerable. That interface basically lets you use the class in a foreach statement (in C#).

ICollection is the most basic of the interfaces you listed. It's an enumerable interface that supports a Count and that's about it.

IList is everything that ICollection is, but it also supports adding and removing items, retrieving items by index, etc. It's the most commonly-used interface for "lists of objects".

IQueryable is an enumerable interface that supports LINQ. You can always create an IQueryable from an IList and use LINQ to Objects, but you also find IQueryable used for deferred execution of SQL statements in LINQ to SQL and LINQ to Entities.

IDictionary is a different animal in the sense that it is a mapping of unique keys to values. It is also enumerable in that you can enumerate the key/value pairs, but otherwise it serves a different purpose than the others you listed.

#post
544 views15:21
Открыть/Комментировать
2021-10-19 18:20:00
What will be the output of the following code snippet?
Anonymous Quiz
83%
8
2%
0
11%
2
5%
16
200 voters530 views15:20
Открыть/Комментировать
2021-10-19 18:20:00
510 views15:20
Открыть/Комментировать
2021-10-18 19:24:00
What is the difference between a Struct and a Class in C#?

Class and struct both are the user defined data type but have some major difference:

Struct

The struct is value type in C# and it inherits from System.Value Type.

Struct is usually used for smaller amounts of data.

Struct can't be inherited to other type.

A structure can't be abstract.

Class

The class is reference type in C# and it inherits from the System.Object Type.

Classes are usually used for large amounts of data.

Classes can be inherited to other class.

A class can be abstract type.

We can create a default constructor.

#post
563 views16:24
Открыть/Комментировать
2021-10-14 21:22:00
Here is a solution for the #challenge above
319 views18:22
Открыть/Комментировать