Array vs Arraylist
Array is a fixed length data structure whereas ArrayList is a variable length Collection class. We cannot change length of array once created in Java but ArrayList can be changed. We cannot store primitives in ArrayList, it can only store objects.
Linkedlist vs Arraylist
ArrayLists are better suited for scenarios where random access is required, whereas LinkedLists are preferred for frequent insertion and deletion of elements. The choice depends on the specific use case and performance requirements.
Linkedlist vs Hashmap
What is the difference between a linked list and a linked HashMap? A linked list is a data structure that allows fast insertion and deletion of elements at any position. A linked HashMap is a variant of HashMap that maintains the order of insertion, whereas a linked list does not store key-value pairs.
Algorithms and Time Complexities (Optimization) click >>>
OOP Concepts click >>>
.NET Generic in C#: In C#, generics are a powerful feature that allows you to write code that can work with different data types while maintaining type safety. The primary motivation behind generics is to create reusable and type-safe classes, methods, or data structures. e.g. click >>>
Generic Classes: You can create a generic class by using angle brackets <T>, where T is a type parameter representing the data type that the class will work with.
Generic Methods: Similar to generic classes, you can define generic methods that accept type parameters.
Constraints: You can add constraints to type parameters to restrict the types that can be used with a generic class or method. For example, you can specify that a type parameter must implement a specific interface or have a default constructor.
Generics are widely used in C# to build collections (like List<T>, Dictionary<TKey, TValue>, etc.), algorithms, and other reusable components, making your code more flexible, maintainable, and type-safe.
#AbdurRahimRatulAliKhan #ARRAK #Code #Programming #Vivasoft #VS #Viva